Network Rail have issued a warning after children were caught taking a selfie on the railway line in Halifax.
Children have also been filmed on the tracks in Shipley throwing stones at the overhead lines.
There were more than 900 instances of trespass on the railway in Yorkshire last year.
The footage has been released by Network Rail, British Transport Police (BTP) and Northern to coincide with the launch of a campaign to tackle the issue of trespass on the railway.
The campaign aims to raise awareness of the dangers of trespassing on the railway and implores young people not risk their lives on the tracks, as well as encouraging parents to instil these warnings into their children.
Hayley Bull, community safety manager at Network Rail, said: “The footage is absolutely shocking; young people in particular need to realise that they are risking their lives when they choose to trespass on the railway.
Chief Inspector Lorna McEwan from BTP in Leeds said: “We believe the number of children we encounter trespassing every year is sadly just the tip of the iceberg
“Every single day we are called to the tracks to incidents similar to those captured in the footage, Train drivers regularly have to sound their horn or apply their emergency brake In a desperate bid to avoid youths on the line, who then run off, seemingly unaware of the danger they have put themselves in.