Kyle Bradley was pronounced dead by the side of the railway line in Wrenthorpe near Wakefield on Saturday.
Another boy aged 16 and a woman aged 18 were left with non-life threatening injuries.
Local residents said there had been problems with young people playing near to the track before.

It will feature in Sunday's first episode of the new series of the long-running programme, which was recorded at Tewkesbury Abbey in Gloucestershire.
Expert Fergus Gambon said it was "unique" and "one of the most important English baby houses in existence".
The doll's house was built in 1705 and is extremely well preserved.
In a first for the programme, a camera crew went to film at the home of the object's owner, after just a few dolls were taken to the recording, which took place in May.
Mr Gambon, who is the son of actor Sir Michael Gambon, said: "As soon as I saw the dolls I recognised the importance of it.
"And it is quite a large object, it's extraordinarily fragile, it's not something that you can just shove in the back of the car and bring over.
"So if we wanted to show the viewers what the house was like, this was really our only chance."
The doll's house is well preserved, with the dolls in their original clothes, and was made on the Isle of Dogs for a Miss E Westbrook.
It has been in the owner's family ever since, being passed down the female line for generations.
Mr Gambon said he had known of the existence of the doll's house after having seen photographs of it in a book from the 1950s.
"I saw the dolls first and I recognised them immediately from the pictures," he said.
"The extraordinary thing about the Westbrook is the fact that it's remained in the family since it was made, and it is essentially a little time capsule."
The Antiques Roadshow at Tewkesbury Abbey will be shown on Sunday August 28 at 20:00 BST on BBC One.

Staff will walk out from 00:01 BST on 12 August until 23.59 BST on 15 August, and for three days over the UK Bank Holiday weekend from 27 August.
The union says the dispute is over unsocial hours and duty rosters for about 80 train managers.
Eurostar said all passengers with reservations will be able to travel.
A spokesman said: "On the days of the strike we have made some small changes to our timetable to ensure that all passengers booked to travel will be able to on those days. Passengers affected will be notified in advance."
The company added it has been planning for possible strike action and is still in discussions with the RMT over the dispute.
Eurostar runs trains between London and mainland Europe and the first planned walk out coincides with the Assumption Day bank holiday in France and Belgium on 15 August.
The RMT says Eurostar has failed to honour an agreement from 2008 over conditions for their staff.
RMT general secretary Mick Cash said: "Our train manager members at Eurostar have a heavy commitment to shift work and unsocial hours and are sick and tired of the company's failure to honour agreements.
"Our members have every right to have a fair work-life balance that fulfils the operational needs of the company while guaranteeing quality time off for friends and family.
"It's now time for Eurostar to come to the negotiating table with a set of proposals that honours our agreements and guarantees our members a genuine work-life balance."
The RMT announcement comes amid strikes by its members on Southern and Virgin Trains East Coast.
Southern Rail staff are in the midst a five-day strike over the role of conductors, while the RMT announced on Tuesday that its members on the Virgin East Coast line voted to walk out in a dispute over staffing changes.
The RMT says the action on Southern Railway workers will be suspended on Thursday and Friday if the company agrees to urgent talks without pre-conditions.

Two other boys, aged 15 and 16, were assaulted and required treatment.
Police were called to reports of a large number of teenage boys involved in a disturbance at Auchinairn Gardens in Bishopbriggs at about 00:05.
The 16-year-old who was seriously assaulted was treated at Glasgow Royal Infirmary and later released. Police are seeking witnesses to the incident.
Det Sgt Jas Juttla said: "Inquiries are ongoing to establish the full circumstances surrounding this disturbance and I would appeal to any witnesses to come forward."
An inquest into the death of a 16-year-old boy who climbed on to a train and touched overhead power lines has been opened and adjourned in Wakefield.
[NEXT_CONCEPT]
An early 18th Century doll's house, described as "of national importance", has been valued by the BBC's Antiques Roadshow at more than £150,000.
[NEXT_CONCEPT]
Eurostar rail workers are to take seven days of strike action this month in a dispute over their work-life balance, the RMT union says.
[NEXT_CONCEPT]
A 16-year-old boy has been seriously assaulted in what police said was a "large-scale disturbance" near Glasgow.