A 14-year-old boy who was killed by an express train at Mirfield Railway Station in January was collecting stones to throw at trains, his friend told an inquest.
The inquest heard that James Greenaway, a pupil at Castle Hall School, was playing on the railway line at the station moments before being struck at high speed by a Manchester Airport express train.
A jury at Bradford Coroner's Court was told how the teenager jumped onto the track with his friend. As both of them tried to climb back onto the platform ledge, the other boy managed to escape but the train caught James.
A post mortem examination showed that the teenager, who lived in Meltham near Huddersfield, died from multiple injuries.
Luke Sykes had been at the station for a couple of hours before he saw the tragedy unfold.
In a statement read to the Bradford hearing, he said he saw a train while he and James were on the tracks. He described how he managed to climb onto the platform but James could not pull himself up in time.
Asked what he was doing on the line when he saw the train, he replied: "We were getting some stones to throw at the train.
West Yorkshire Coroner Roger Whittaker said: "You must have known it was dangerous to play near or on railways. You accept that. "Yes," replied Luke.
Train driver Barry Carver was travelling at 75mph when he noticed two 'figures' in the distance walking towards the end of the platform.
Mr Carver then blew his horn when they appeared to jump down onto the line in front of him before they turned round and tried to climb back up.
David Gemlo-Dunstan, station facilities manager for Arriva Trains, told the hearing that measures could be taken to reduce problems with safety measures including 'anti trespass' timber guards on platforms and CCTV.
Recording a verdict of accidental death, Mr Whitttaker said he would like to see CCTV installed at the station and linked up to a system in the town so that groups can be moved on if they congregate.
He also believed a stricter policy on the prosecution of trespassers. Mr Whittaker said he would be contacting West Yorkshire Police to see how other tragedies could be minimised.