The trolley problem is about innocent people. When one of those people is the reason the others are in danger because they are actively trying to kill them, the problem kind of goes away. Almost nobody says you should just let them continue murdering.
If you can tie someone to tracks then you have complete control over them. That's not defensive violence against the murderers, it's an elaborate execution. It's not about whether their souls are clean or whatever, it's about whether there's an immediate need to kill them.
My position is that the death penalty is never justifiable. The point is that this person presents a danger and for whatever reason you can't stop them with a less permanent method.
We didn't stipulate the track tying murderer was being executed, looks like they're fighting on top of a train. There may not have been any options to stop them falling off the side.
And of course they're dangerous, they tied a huge number of people to train tracks against their will. That implies a lot of strength, cunning and martial skill, and willingness to do harm up close and personal. Without overwhelming force the only way to neutralise a threat like that may be to kill.