Spencer Walker, aged 12, died on October 5, 2016, two days after his foot touched the wire and he fell onto the track below, Wakefield Coroner's Court heard today.
The jury inquest was told that other children warned him not to touch the cable after he asked about what would happen if he did.
The incident happened on a footbridge over the railway belonging to Wakefield Council, at the bottom of Beaumont Avenue, in South Elmsall, in the Wakefield district.
Witnesses reported seeing a flash and hearing a loud noise at around 5.50pm, which one person described as sounding like "a bunch of fireworks going off".
People rushed from nearby houses to assist at the scene.
Members of the jury heard that Spencer climbed over onto the outside of the bridge, and made his way along the side of it, past spikes designed to stop people from trespassing, until he was above an overhead wire.
Witness statements read to the court said he reached down and touched the wire with his foot.
Emergency services were called to the scene and Spencer was taken to Leeds General Infirmary for treatment.
Despite medical attention, he died at 3.30pm on October 5 two days after the incident.
Paediatric pathology Dr Jens Stahlschmidt told the court Spencer had suffered injuries including burns due to electrocution and a serious head injury.
Spencer's grandfather Graham Walker took to the witness box on behalf of the family. He confirmed to coroner Jonathan Leach that they were concerned the bridge spikes were too short and to few in number and there were no signs present at the bridge to highlight the high electricity voltage of the overhead wires or warn of danger.
Alistair Dore, a section engineer in the bridge team at Wakefield Council, said that since the incident, warning signs had been put up.
He said: "You can only do so much. you can deter trespass, you can put people off and you can make it as difficult as possible, but there comes a point when you can do no more."
The inquest continues.