Rail workers and children will be taught about the dangers of working and playing on train tracks through virtual reality.
Motion Rail Ltd, based in Ebbw Vale, Blaenau Gwent, has designed two virtual training programmes to improve training and educate children.
The first children to use it will be pupils at Ysgol Y Fenni in Abergavenny, Monmouthshire, on Friday.
Network Rail said the scheme was a "brilliant way" to educate children.
Managing director of Motion Rail, Emma Gilchrist, said children were presented with a level crossing and had to cross it safely by following the right sequence of tasks.
She said the aim was to highlight the importance of not being distracted and not looking at their phones.
"If the children cross the white line where they're told to stop, the train will pass - it does hit them if they cross the line, but it doesn't present any gore, it's sort of CCTV of what happens to them."
Ms Gilchrist said most children laughed and it was not frightening and they hoped by making it fun it would make them more likely to remember what they had been taught.
In 2016-17, 39 people died on railways in the UK - 33 members of the public and six workers.
Most public injuries were as a result of trespassing or incidents at level crossings.
In the same period there were also 5,676 injuries to rail workers, 164 of which were classed as major.
The programme aims to make employees aware of the appropriate amount of time needed to move out of the way when a train is approaching, giving them a real-time scenario in a safe environment.
Andy Thomas, managing director of England and Wales at Network Rail, said: "By engaging with young people early, we can raise awareness of rail safety and help keep the communities we serve safe."