Greg can't stop the train, and, if Greg is human, he can't predict specific outcomes either, but, what Greg can do is choose to cause harm or not. Greg should not direct the train towards the five people the train is not already heading for. This would be Greg causing harm. Those who argue that Greg could save 40 lives by taking five lives ignore the fact that Greg cannot predict whether the 40, or even 35 of the 40 would notice the train and get off the tracks. He also cannot predict whether switching the tracks would cause the runaway train to derail and cause even more deaths. He also cannot predict whether the five other workers might even be working on a remote switch which they could use to send the train down a track which isn't being worked on as long as Greg doesn't change the tracks first, saving everyone. In a very real sense, the futures that Greg cannot specifically predict do not exist, but the present does exist; it's the only time we can live in. Greg should choose to cause no deliberate harm in the present, while doing harmless things which could reasonably create general good in the future. In this case, shouting a warning to the 40 the train is heading for.