Trolley Problem & Torah (Part 1)- Tunnel Dilemma

(ו) הָאִשָּׁה שֶׁהִיא מַקְשָׁה לֵילֵד, מְחַתְּכִין אֶת הַוָּלָד בְּמֵעֶיהָ וּמוֹצִיאִין אוֹתוֹ אֵבָרִים אֵבָרִים, מִפְּנֵי שֶׁחַיֶּיהָ קוֹדְמִין לְחַיָּיו. יָצָא רֻבּוֹ, אֵין נוֹגְעִין בּוֹ, שֶׁאֵין דּוֹחִין נֶפֶשׁ מִפְּנֵי נָפֶשׁ:

(6) A woman who was having trouble giving birth, they cut up the fetus inside her and take it out limb by limb, because her life comes before its life. If most of it had come out already they do not touch it because we do not push off one life for another.

סברא הוא כי ההוא דאתא לקמיה דרבא אמר ליה מרי דוראי אמר לי זיל קטליה לפלניא ואי לא קטלינא לך אמר ליה ליקטלוך ולא תיקטול מאי חזית דדמא דידך סומק טפי דילמא דמא דההוא גברא סומק טפי

It is based on logical reasoning that one life is not preferable to another. The Gemara relates an incident to demonstrate this: This is similar to a certain man who came before Rava and said to him: A local official said to me: Go kill so-and-so, and if not I will kill you. Rava said to him: It is preferable that he should kill you and you should not kill. What did you think, that your blood is redder and more precious than his? Perhaps that man’s blood is redder. Apparently, one may not save his own life by taking someone else’s.

Tosafot on Sanhedrin 74b

רוצח גופיה כי מיחייב למסור עצמו ה"מ קודם שיהרג בידים אבל היכא דלא עבידמעשה כגון שמשליכין אותו על התינוק ומתמעך מסתברא שאין חייב למסור עצמו דמצי אמר אדרבה מאי חזית דדמא דחבראי סומקי טפי דילמא דמא דידי סומק טפי כיון דלא עביד מעשה

שנים שהיו מהלכין בדרך וביד אחד מהן קיתון של מים אם שותין שניהם מתים ואם שותה אחד מהן מגיע לישוב דרש בן פטורא מוטב שישתו שניהם וימותו ואל יראה אחד מהם במיתתו של חבירו עד שבא ר' עקיבא ולימד וחי אחיך עמך חייך קודמים לחיי חבירך

If two people were walking on a desolate path and there was a jug [kiton] of water in the possession of one of them, and the situation was such that if both drink from the jug, both will die, as there is not enough water, but if only one of them drinks, he will reach a settled area, there is a dispute as to the halakha. Ben Petora taught: It is preferable that both of them drink and die, and let neither one of them see the death of the other. This was the accepted opinion until Rabbi Akiva came and taught that the verse states: “And your brother shall live with you,” indicating that your life takes precedence over the life of the other.