It's a lose-lose situation. Therefore, as we all know, the proven answer is to flip open your communicator and tell Scotty to beam up all the people tied to the tracks. If you're in command, you don't accept lose-lose situations, unless some expendable engineering red-shirt is in the line of fire... ... Anyone that could logically determine the correct moral choice and then act on it, rather than wasting this time trying to save everyone, would not be considered human. Vulcan maybe, but not human.