If there are no alternatives, then is there a question? It is your hypothetical, but if you are asking whether it is moral to take a life in order to protect others, then aren't you really asking whether war or the death penalty are moral? AND, the question presupposes some agreement upon what is or is not moral. If I am part of a pirate community, killing, plundering, raping, and pillaging are moral. If I am an L.A. gangbanger, killing is moral. If I am an Amazonian tribesperson, killing may not only be moral, but it may be a spiritual experience. If I am Musashi, killing is moral and a path to enlightenment.
As you have noted, the Bible says quite clearly that we should not kill, but Ecclesiastes recognizes there is both a time to kill, and a time of war.
You set the scene. SO, if you draw a room with no doors or windows, no way in or out, and place us in the room, then our only options are to be in the room or to not be at all. Is this your hypothetical?
Robb in Sacramento