Electricity in the fan cord traveled much faster than the estimated 36 billion years (at least, from Problem Sleuth's perspective) due to BHMK dilating time with his immense gravitational pull.
In The Medium, John Egbert's house still has electricity, despite the wires being severed. This indicates that it is being generated out of nothing. This is most likely caused by the Sburb itself. Seeing as it is critical to have a functioning computer as well as internet access to play, it is understandable that there would be means to keep both active without physical connections. After all, if this were not true, then there would be no means to get other players into the Medium.
Doc Scratch's tower is also shown to have electricity, as The Handmaid was