I think this would be a fairer solution.
Put the trolley and trolley tracks in a box with an emitter of radioactive particles and a detector that will switch tracks if it detects a radioactive particle.
All the people on the tracks will be both dead and alive unless someone looks inside the box.