Philippa Foot is most known for her invention of the Trolley Problem thought experiment in the 1960s. A lesser known variation of hers is as follows:
Suppose that a judge is faced with rioters demanding that a culprit be found for a certain crime. The rioters are threatening to take bloody revenge on a particular section of the community. The real culprit being unknown, the judge sees himself as able to prevent the bloodshed from the riots only by framing some innocent person and having them executed.
These are the only two options: execute an innocent person for a crime they did not commit, or let people riot in the streets knowing that people will die. If you were the judge, what would you do?
Having skimmed the original paper about the trolley problem, I think what the author was trying to illustrate was the difference between direct and indirect harm.
If you redirect the trolley, you’re not trying to kill the man on the other track. You’re trying to save the five on the first track by directing the trolley away from them. While the other man may die because of this, there’s always the possibility he’ll escape on his own.
Whereas if the judge sentences an innocent man to death, that is choosing to kill him. The innocent man MUST die for the outcome the judge intends. So there’s culpability that doesn’t exist in the trolley scenario.
In one case you’re accepting a bad outcome for one person as a side effect, in the other you’re pursuing it as a necessary step.