A man is lucky to be alive after a high-speed train narrowly missed hitting him on railway tracks near Ballan.

The rider was attempting to get his dirt bike across the tracks as train driver Colin Sharp approached him, travelling at 160 km/h.

The man jumped off the tracks with a split second to spare, and possibly “scraped the side of his boots” on the carriage, Mr Sharp told radio station 3AW.

“As I came around the corner I was doing right on 160 km/h and as soon as I saw him, the emergency brake I had to apply and still went past him doing 147 km/h at that stage,” he said.

“I thought I had him,” he said. “His bike was in tiny bits and pieces – there was nothing left of it. I couldn’t believe how a bike could disintegrate like that.”

Mr Sharp said when the rider saw the train approaching, he attempted to get the bike across the tracks but “finally got some sense and decided to get himself off” leaving the bike on the tracks.

V/Line has released dash cam footage of last month’s incident, warning the public against trespassing on railway tracks. It was one of 300 near misses on the network last year.

Chief executive James Pinder said it could take up to one kilometre for trains to stop when the brakes are applied.

“Our trains travel at up to 160 km/h … Trains approaching at high speed are quieter than expected,” Mr Pinder said.

“When people are reported on the tracks, V/Line often stops trains running in both directions, which can cause lengthy delays for our customers.

“I’d encourage people to only cross railway lines at marked crossings, respect all warning signs and always look both ways as trains can come from either direction.”

Mr Sharp said there was a marked crossing just 50 metres from where the rider attempted to cross the tracks.