Death happens to everyone eventually. No way around that, at least not yet. The most I can do with a trolley switch is possibly affect the timing.
It seems to me that any time I pull the lever to direct the train toward a person (as opposed to toward other trains or lobsters or money), I'm causing the death of whoever is on the other track to happen sooner. I'm killing them.
But if I don't pull the lever, if I don't intervene, I'm allowing death, which was already coming, to come to whoever's on the original track.
As a principle, the distinction between killing and allowing to die really starts to make itself felt when we're talking about the difference between, say, turning off a respirator to allow someone to die, versus actively euthanizing someone by administering medication to stop their heart, even though in this case, both involve an action.
To me, those aren't the same act. There's no moral obligation to try to extend life as long as technologically possible. Death comes and that's OK. But there is an obligation not to cause death, and an obligation not to pursue it as its own end.