You want to shoot for the "ohhh" moment.
I insert foreshadowing of future plot twists or events often in my D&D games as the Dungeon Master. It often feels like dropping subtle breadcrumbs, so small that the reader who isn't paying attention will miss them but large enough that they'll stick in the reader's brain for later as an odd detail that needs explaining. As with most things in writing, the key to effective foreshadowing ends up being a subtle touch. You want your clue to be ambiguous or vague in the moment, and perhaps even so small that the reader will just skim right by it, but have it make much more sense in hindsight after knowing the "twist." Depending on how overt you want the clue to be, the reader should either be aware that there's some missing piece of information in this scene that they might learn later, or they should not even notice the clue until that magical click moment when it makes perfect sense. In effect, you want the reader to go back to your clues, put them into a new context with the new information they just learned, and say: "Ohhh! Now that makes sense."
In your specific case, you want to have a conversation between two characters where there is a vital missing piece of information that puts their conversation into a new context. In this case, I think a very effective way to drop your breadcrumbs is to rely on a classic story trope: "As You Know."
This is a form of exposition where one character explains to another something that they both know, but the audience doesn't or may have forgotten.
In your case, the two characters will already know their secret relationship. They'll know that one of them is actually the superior of the other. The audience, however, must be kept in the dark about this, and you can achieve that effect by remembering that two characters who know a secret will not go about openly discussing that secret. It's not like one soldier will go up to the other like "hello, person who is secretly my superior!" As a result, there's a logical reason they will only reference it vaguely, perhaps through private in-jokes, instead of loudly expositioning it to the audience.
Maybe something like a little "nod and wink" that will make sense later.
The soldier nodded, and a tiny smile flickered on her face, just for a moment. "You're my superior, ma'am," she said. "I have to listen to you."
Commander Jamisen chuckled. "Of course you do," she said. "That's your job."
Without the vital piece of context, this is just a strange comment or maybe just a jab between friends. But with the context of their secret relationship, they're having a private little in-joke about how the soldier really is the superior.
Alternatively, you can do something like Squid Game.
!! WARNING: SPOILERS FOR SQUID GAME BELOW. !!
In Squid Game, a South Korean survival drama show about desperate people who get drawn into a death game, there is a contestant on the show, an old man named Il-nam, who is secretly the creator and/or benefactor of the show. This is hinted in very subtle moments throughout the show that make much more sense in hindsight. For example, during a scene where the group of contestants on the show have to vote about whether to continue the show, it is subtly noted that Il-nam gets the deciding vote, almost as if he has more deciding power than the others. In another scene where the contestants are brutally fighting and killing each other after lights out, Il-nam begs for it to stop, and the organizers immediately step in the moment he does so, as if he's the one who controls them. These are all blink-and-you'll-miss-it clues, but once you build them up it suddenly makes everything make sense.
There are many other excellent resources for how to achieve effective foreshadowing.