Video footage has been released showing two adults taking a toddler across a level crossing after its gates were locked.
They passed the youngster over a six-foot high gate and ran over the tracks in front of a train as it pulled into Seamer station near Scarborough, North Yorkshire at around 6.30pm on New Year's Eve.
Trapped inside the crossing, they then climbed over a second gate and ran to the platform in an apparent bid to catch the train - which they missed anyway.
Network Rail's level crossing manager Robert Havercroft said the adults had shown "reckless disregard" for a system which is designed to keep people safe.
He went on: "In making the mind-blowing decision to not only climb over two sets of high, locked gates, these adults have put their lives and the child's life in extreme danger, apparently for the sake of trying to catch a train.
"They had no way of knowing for certain that the approaching train was stopping at the platform and they were lucky to avoid this becoming the most disastrous way to end the year."
CCTV images from another incident show two men pushing through barriers at a crossing in Chiswick, west London on December 22.
Some 172 trains pass through the crossing each day, travelling at up to 60mph.
Network Rail's route managing director Becky Lumlock said: "There's no excuse for this kind of reckless behaviour.
"A trip or a stumble while trying to run across is all it would take, and the train driver wouldn't have enough time to stop."
Inspector Becky Warren of British Transport Police said: "Despite our constant warnings about using crossings safely and the dangers of the railway, incredibly some people are still willing to put their lives on the line by ignoring crossing instructions, not looking properly or by trying to dash across crossings when trains are approaching.
"As a police officer, I have had to deliver messages to families that their loved one has been killed by a train at a level crossing. Please, think and never take the risk."
Figures from the Rail Safety and Standards Board show that three people, all pedestrians, were killed at level crossings in Britain during 2015/16, excluding suicides and suspected suicides.
On January 3 a driver was killed after his car was struck by a train at a level crossing near Lidlington station in Bedfordshire.