The old guy ignored the closed gates at the level crossing at Albion Park rail station and then flagged down the train so he could cross over.
That's part of the startling footage released by Transport for NSW to highlight Rail Safety Week.
The footage comes from CCTV at the Albion Park Rail station, where the southbound platform is accessed via a level pedestrian crossing at the southern end of the station.
An old man is seen arriving at the closed gates of the level crossing and then tries to open them.
He finds another gate nearby that he can open and then walks to the edge of the tracks.
He's about to cross over when he looks to the right and sees the reason the gates were closed - a train is heading his way.
Because he is so close to the tracks, the train driver has to stop short of the platform and then the man waves his thanks and crosses over.
And, yes, you can see the train driver expressing their displeasure.
Footage from Woonona station shows a pedestrian strolling along the road past the closed boomgates, only realising once they're on the tracks that a freight train is coming.
"The reckless behaviour in this footage is very concerning," said Regional Transport and Roads Minister Paul Toole
"They're not only risking their own lives, but spare a thought for the train driver, who very easily could have had his life changed forever.
"You might think you are saving yourself some time, but as you can see in some of the security camera footage, an oncoming train with no way of stopping could be just seconds away."
From July 2008 to May 2021 there were 83 collisions between trains and cars at level crossings in NSW.