"I looked at my side mirror and I saw a big cloud of dust.
"I thought: ‘Holy s**t someone has just been hit by a train’,” he said.
McIlory said the train’s horn sounded moments before the impact.
The train - two connected locomotives - hit the front of the Toyota Corolla, spun it around and pushed it off the tracks and on to a grass verge on Leeston Dunsandel Rd.
The railway crossing lights were flashing and the bells were sounding.
When McIlory went over to check on the man, he was out of his car and walking around.
“He was pretty shaken.
"He just said he didn’t see the train.
"He’s probably very, very lucky to be alive still.”
“He was extremely lucky.”
McIlory called 111 and stayed at the scene until emergency services arrived.
A Hato Hone St John spokesperson said it responded with two ambulances and a rapid response vehicle, but the driver declined to be assessed.
McIlory said he felt sorry for the train driver.
"They probably wouldn’t have known what they were walking back to."
In the year to June 30, 2023, 40 vehicles or individuals collided with trains on the national rail network, with 305 near misses.
There were 11 crashes and 192 near misses at level crossings.