A railway company has been fined £180,000 for breaches of health and safety law which led to the death of a teenage boy, the regulator's office said.
English, Welsh and Scottish Railways International (EWSI) was also ordered to pay costs of £59,554 at Liverpool Crown Court after a prosecution brought by the Office of Rail Regulation (ORR).
It follows the death of Liam Gill, 13, who was electrocuted after climbing to the top of a rail wagon in a disused depot.
Liam and two friends trespassed on the disused Allerton rail depot, in Liverpool, in August 2009 having gained access through a gap in the boundary fence, the regulator said.
The depot contained a number of abandoned train wagons which were stored beneath a live 25,000 volt overhead power line.
Liam climbed on to the roof of a train wagon and was electrocuted and died of his injuries, the ORR said.
His two friends, both aged 14, suffered severe burns.
Ian Raxton, ORR's Principal Inspector, said: "This was a devastating incident.
"Liam Gill's tragic death and the serious injury of two teenage boys could have been prevented.
"My thoughts are with Liam's family and all those involved in this incident."
The regulator said Liam's death was caused by EWSI's failure to manage safety risks at the site.
It said the judge found that EWSI was aware that trespassing was taking place at the depot yet did not take sufficient steps to prevent unauthorised access to the site.
The ORR said it is also "totally unacceptable" to leave unused high voltage overhead cables switched on in a largely abandoned depot which is known to be accessed by trespassers.
Mr Raxton said 53 trespass fatalities were reported in the last year.
He added: "There is no denying that Liam and his two friends should not have been trespassing. Trespass on the railway poses serious safety risks.
"The rail industry spends a great deal of time attempting to educate young people, as well as to ensure suitable security on the network.
"Despite this effort, more must be done.
"There is no excuse for companies to not take appropriate action against trespass."
EWSI pleaded guilty at Liverpool Magistrates' Court in October and November 2011 to one charge under the Health and Safety at Work Act and one charge under the Management of Health and Safety at Work Regulations.
Enforcement action has been taken requiring the company to repair the boundary fence at Allerton and to switch off the electric supply to the unused overhead lines, the ORR said.
A spokesperson for EWSI said: "Our thoughts remain with the family and friends of Liam Gill following the conclusion of court proceedings.
"We will continue to work with others in the rail industry and local communities to help educate children and young people on the dangers of trespassing on the railway."