Question: If you had the chance to save 1,000 people’s lives knowing that you would die in the process, and no one would know it was you who saved them, would you do it?
Answer: My answer to this question might sound “cold”, calculating, but it is based on the precise knowledge of our underlying Human nature. And in order to succeed in life first we need to know ourselves, what program drives us.
Since we are born with a completely self-serving, self-justifying, self-protective nature, and all our calculations are based on the introverted, egocentric “pleasure/pain principle”, we can only act, do anything if the reward we receive is greater than the effort we need to exert for it. Otherwise our ego does not supply “fuel”, does not grant permission for the action.
Thus on the instinctive, animate level if I know for certain that my action results in the termination of my own animate existence, I cannot act in such a way, as long as my “animal” calculates in the usual, instinctive manner based on the primordial survival instinct.
If on a higher “Human” level I calculate that my life is worth nothing and I personally gain by terminating myself (like in a case of depression, intolerable suffering) then by “switching off” my physical consciousness, perception I gain reward, thus I can act against my own physical survival.
Moreover if I calculate that by sacrificing myself for others I gain extraordinary respect, adulation, “eternal glory”, guaranteed entrance to Heaven, next life, spirituality, serving my Nation or a great leader (if such notions gained all-encompassing importance in my eyes), then this greatly increasing self-esteem can override the physical survival instinct. (In your scenario nobody would know I acted which wipes out most of the above motivations.)
And there might be other variations of the “theme”, but at the basis, at the root of any action there always remains the egocentric “pleasure/pain” or personal “cost/benefit” calculation. And in this respect it is completely irrelevant how many people or anything else – that brings the hoped for reward – I can save.