It's a matter of causality, responsibility and available information.
How much are the lives of those people worth?
A priori they all are worth the same. A posteriori there is no reachable consensus or possible objectivity to quantify their worth, even if you had perfect information.
Therefore, either (a) you make assumptions and prejudice they are all worth the same or (b) you suspend any action until you can make the right decision. Note the difference.
the lack of action is just as much a deliberate choice
It's not a choice, it's the suspension of any choice until a good decision can be made. The train is not going to wait that long, but that is just bad luck (or a causal chain).
Any action has a set of causes and a course. If you change the course of some action, you are part of the causes of whatever comes after that. The only possible responsible options are not to interfere or change the course of action only when it is meant to be for the better and there are good reasons to think so.
That's why it's not right to make those decisions, unless you are specifically assigned to do that. E.g. you are responsible for the train.
We, in society, don't like people making decisions on the live of other people unless they are specifically assigned to that. E.g. judges or medics. And when some person has to do that there is usually a well established praxis, rules or protocol.
If someone makes such a decision, that person is not only making that decision, that decision would also mean establishing a precedent about how some people (or anyone) can make decisions on other people's lives with (unavoidably) partial information. Ethics is basically about that kind of rules, so that would be completely unethical. Not by doing something that is bad per se (killing people), but by doing something that is destroying the rules followed in the society (moral).
PD: a similar dilemma could be whether it's right to judge to experiment on some people for the advance of science and saving innumerable lives. How many people could we sacrifice to find a cure for cancer? How many people is going to die due to cancer in the next century? Consider you are a politician. If you sign and support a law, experiments will be conducted on 10K people, and it is certain this will save the life of 100M people in the next century, if you don't sign then that will not happen and 100M people will die due to cancer in the next century. Is it right to make that decision?