If you are looking at it as a technical issue, why do you assume the intent was to save a life? Maybe girl is correct and the question is "which one(s) do you kill? She demonstrates some thinking outside the box.Throw the switch as the railcar's front wheels pass, causing a derailment immediately after the switch, saving all.
Then again, I see this as a technical issue rather than a moral on. My psych prof rolled his eyes a LOT in college.