It’s a neat thought experiment, as it teases out how far people take utilitarianism. For most of us, there are actions that we feel are ethically wrong even if utilitarian.
In terms of Buddhist ethics…
Does intentional inaction create Kamma? If we make the choice not to turn the wheel, does the fact our choice was inaction protect us from Kamma?
If intentional inaction does not create Kamma, then it seems we are safer not to protest, not to speak out, about the issues of the day. From a strictly Buddhist point of view, if inaction is always kammically safe, it seems the best recommendation would be to stay out of the issues of the day. That, for many of us, doesn’t seem a very satisfying conclusion.
If intentional inaction does produce Kamma, then we produce Kamma whether we intentionally turn the wheel and kill one person or intentionally leave the wheel untouched and kill four. So it is then just one of those unfortunate things that happens sometimes in life, which is fine. The important thing then is not to pretend we kept ourselves above the consequences by choosing inaction.
Of course, if we produce Kamma either way, would that mean an arahant would produce Kamma either way? He/she would still take one of the same kamma-producing actions. So it is useful to remember than arahant still has consequences to their actions, and they are still subject to consequences. Just because the person who does something is an arahant doesn’t mean they can’t be sued, for example. So the escape from Kamma only refers to the fact there will be no next life to suffer the consequences.
Note. I’m sure there are arguments explaining where I went wrong in anything I said that doesn’t fit within the Buddhist framework. I don’t for a second believe some rando playing through a thought experiment on the internet is going to come up with anything that hasn’t been thought through. So I am sincerely interested in understanding any places my thought process went wrong.