Do I know anything else about these people? Are any of them parents, single parents, only children, etc? Did the one person make a smart choice that got him/her out of danger? Did the five people make a careless decision that put them in danger? Is there any way I might pull the one person out of the way- maybe I have a tool that would free him/her and enough time to save just the one?
Also, would switching the tracks be considered homicide, where letting the five people die wouldn't implicate me at all? Because without the law criminalizing actions on my part, my instinct is to switch the tracks and kill one person instead of 5, because statistically one person's death would cause less overall pain.
I would also, after making my split-second decision regarding the tracks, try to find a way to save those who were still in danger.