This Cop Saves A Man From Being Killed By A Train

We aren't sure how the cop knew this guy was in trouble, but we do know that the officer is a hero.  This is body cam video of a cop running alongside some railroad tracks because he's trying to stop a train from hitting a guy in its path.  He's yelling at the top of his lungs, and the guy jumps away at the last second.  Why didn't the man hear the train?  Why didn't he move on his own?  We don't know, but we do know that the man was incredibly thankful the police officer was there to help.  After the guy recovers, he tells the cop, "Where'd you come from?  Thank you."