The passenger was scrolling on his phone when he nearly ended up on the tracks.