As @Galastel mentioned, that kind of situation elicits a knee-jerk reaction, so let's try to get the sex out of the equation for a bit:
A is the mentor, B is the pupil.
This very relationship means that B is inferior to A, whether it be in terms of skill, knowledge, experience, strength or something else. In fact, the more of those terms B is at a lower level, the more B is seen as inferior to A and, as such, the more need there is for that character to proof their worth.
A being superior to B, it means that A will typically be the one saving B (whether literally - eg. in a fight - or metaphorically - eg. through teaching new skills). In the rare occasion where that role is reversed, one can expect...
1) B teaches A a new skill, imparts knowledge, etc: expect such skill/knowledge to be something of minor importance in survival, but important in social aspects (eg. A is a loner and must learn the joys of having a companion).
If A's a protagonist and the skill/knowledge is duly assimilated, this will allow A to grow as a character.
If B is a supporting character, either the skill/knowledge is duly assimilated, allowing for B to mentor A in a role reversion, or the skill/knowledge might not be assimilated (eg. it's too difficult for B to change ingrained habits) and B is shown to be superior to A in at least one level, which is typically highlighted as of being fundamentally important (eg. socialising, showing empathy, etc). In the last case, expect A to finally appreciate the importance of said skill/knowledge at the moment B has learnt all there was to learn and is ready to move on independently.
2) B literally saves A's life but, being underskilled, gets seriously wounded (or is taken captive) and must be helped / rescued by A, thus making sure the role reversal is:
a) if A is the protagonist: a relatively hollow example of B's importance as a character, and I say hollow because the status quo is not really meant to be challenged
b) if A is the protagonist: nothing more than a token example of B's bravery, but underlining how B cannot possibly stand alone
c) if B is the protagonist: a proof of B's bravery and a foreshadowing of successful deeds to come, underlining how B is on their way to stand alone
Since the question is about heroic life saving deeds, let's focus on that scenario.
If the mentor is the protagonist, any heroic action the side-kick may undertake will typically be overshadowed because the protagonist mustn't be overshadowed. This means that A will be saved by B, but then B must be saved by A in some way so as to restore the status quo.
In the case where B is the protagonist, the sequence 'B saves A and A saves B' can be played as a signal that B is not yet ready to move on, and it will probably lead to a sequence where B saves A with no need of further rescue, or B fails to save A and must do the last part of their growth on their own.
Since the question poses the mentor as the protagonist, let's focus on that.
Even if the author does no wish to do so, the sequence 'B saves A and A saves B' will typically overshadow B's actions because it doesn't challenge the status quo, it just inverts it temporarily. A is the protector, gets protected once, and quickly resumes their protector role.
How to avoid this?
Making sure the status quo is not wholy reverted to is one way.
Another way is ascertaining that A isn't really a protector, but just a mentor. A shows the way and opens B's horizons, but B is capable of standing on their own in most situations.
A yet different way is making sure that even though A is stronger, B is strong too and maybe even in similar ways. After all, just because a world-titled boxer is a great fighter, doesn't mean his opponents are weaklings.
This last point leads me to yet another one: strength. So B saved A and got critically injured. Even if B is bed ridden, B can still show fortitude in dealing with pain and making an effort to recover as quickly as possible. It doesn't even mean resenting A's help in aiding the recovery. However, A cannot have a paternalistic attitude, quite the opposite. A must feel renewed or strengthened respect for B. If, before, A felt himself a bit superior to B, due to the difference in skills and abilities, A may now recognise a degree of equality, at least in terms of bravery.
Reinserting the sex, I think that a good way to find balance is to compare different combinations in the same scene: Both A and B as men, both A and B as women, A as a man and B as a woman, A as a woman and B as a man.
If two or three of the combinations elicit overshadowing of the heroic deed, then the problem isn't the knee-jerk reaction to a possible 'damsel in distress' and the scene (or its follow-up) should be reviewed and adjusted. If the sense of overshadowing is only present in the A-male B-female scenario, then it's a knee jerk reaction and the scene in itself is fine.
Nevertheless, one can try to diminish the knee jerk reaction:
strengthen the feel of respect of A for B,
make sure that even though B is out of the fight she is still actively doing her best to help and/or recover using skills that were not affected,
frame her being 'out of battle' as positive rather than negative (eg. she decides to stay put not because she's a liability or a burden to the others but because that is what she needs to recover),
play down A's saving (eg. he's not saving her; he's just helping her... even if that boils down to saving her)
use the camaraderie to ascertain nobody feels she's in need of special protection,
use the camaraderie to focus the characters on her deed rather than the fact she needed saving afterwards (eg. not 'you were great despite having got hurt' but rather 'that really took guts' or 'you're the kind of person I want to have around in a bind')