הָאִישׁ קוֹדֵם לָאִשָּׁה לְהַחֲיוֹת וּלְהָשִׁיב אֲבֵדָה. וְהָאִשָּׁה קוֹדֶמֶת לָאִישׁ לִכְסוּת, וּלְהוֹצִיאָהּ מִבֵּית הַשֶּׁבִי. בִּזְמַן שֶׁשְּׁנֵיהֶם עוֹמְדִים לְקַלְקָלָה, הָאִישׁ קוֹדֵם לָאִשָּׁה:
Ein Mann geht einem Weibe vor hinsichtlich der Rettung des Lebens und der Wiedergabe des Verlorenen, dagegen hat ein Weib vor einem Manne der Vorzug hinsichtlich der Bekleidung und Befreiung aus der Gefangenschaft. Stehen Beide in Gefahr, geschändet zu werden, so muss der Mann vor dem Weibe befreit werden.
Mishneh Torah, Gifts to the Poor
A woman takes precedence over a man for feeding, clothing, and bringing out of prison, because it is more usual for men to go door to door [to beg] and not for a woman who feels great shame in this. But if both of them [a man and a woman] were in captivity and were in danger of being violated sexually, the man takes precedence for redemption, because this is not the way of things.158See Mishnah Horayot 3:7, Babylonian Talmud Ketubot 67a.
Shulchan Arukh, Yoreh De'ah
A woman is redeemed before a man; but where pederasty is common, the man is given precedence. (If both are willing to drown, the man is rescued first.)