The driver was forced to come to a halt on the tracks when he saw a man in distress