Flowers were left at railings at the side of the tracks near Bedford Road in Bootle, Merseyside, on Tuesday after the boy died on Monday.
A British Transport Police spokeswoman said officers were called to the line in Bootle shortly after 7pm following reports of a casualty on the tracks and a 12-year-old boy was pronounced dead at the scene.
She said: "His injuries were consistent with electrocution and the incident is not being treated as suspicious.
"The boy's family have been informed and are being supported by specially trained family liaison officers."
Neighbour Sonia Melton, 33, said her 11-year-old son was friends with the boy who died, who has been named locally as James.
She said: "We're in bits, my heart goes out to his mum.
"Last night we saw all the police and fire engines but we didn't find out the names until this morning.
"He was a lovely kid, they're all lovely kids round here. My son used to play out with him."
Ms Melton bought red roses and said she would take her son to leave them as a tribute once he was home from school.
A bunch of flowers had been tied to railings at the scene with the message: "Shine bright like a diamond. You was the happiest little boy. You will be missed by your girlfriend Ellie."
A boy and his mother left a card with a poem inside which said: "A golden heart stopped beating.
"Two shining eyes closed tight."
Another note in the card, in a child's handwriting, said: "Going to miss you mate, why would you do such a thing."
DCI Steve Lewis, of British Transport Police, said: "This is an incredibly tragic incident which I know will have shocked many in the local community.
"I would like to extend my deepest condolences to the boy's family and request that they are given the space and privacy they need to come to terms with this devastating loss.
"While we have no reason to believe there were any suspicious circumstances to this incident, we are still working to establish the full circumstances behind the boy's death. I would like to appeal to anyone in the area who may have seen two young boys on the tracks around this time to get in touch with us."
A spokeswoman for North West Ambulance Service confirmed an ambulance, rapid response vehicle and members of the Hazardous Area Response Team had been sent to the scene.
A Merseyrail spokesman said: "Our thoughts are with the family and friends of the victim at this difficult time. We are working with British Transport Police as they investigate this tragic incident."
Anyone with information can contact police by texting 61016 or calling 0800 40 50 40, quoting reference 488 of 14/10/19.