An image of a child seen lying on the platform of Trowbridge station, with his head over the edge, has sparked an investigation.
The picture was taken by Tim Brown, who was travelling in Wiltshire but also works for Network Rail, as he was concerned for the boy's safety.
Mr Brown shared the image on social media, along with the response he said he got from the man who was with the young children.
Network Rail is currently running a campaign to combat dangerous behaviour on the tracks.
They say the number of young people taking risks has soared by almost 80% in the past five years.
British Transport Police say they are investigating after seeing the photograph and are making enquiries but no arrests have been made.
"We ask the public to take care when using the rail network, and to follow the safety guidelines provided by rail operators to avoid risking lives or serious injury."
Great Western Railway, who manage Trowbridge station say:
"Trains often pass through railway stations without stopping, and without appearing on any timetable, at very high speeds.
"Stay safe by keeping back from the platform edge and behind the yellow line at all times, and listen out for announcements."
Tim Brown says he hopes the photo will encourage others to talk about rail safety.