In the US it will vary some from state to state in some details. But in most states I'm sure, even bicycles have to obey all road laws if using the road. So that means 25 mph on a residential street in my town, and 15 for a school zone when the lights are flashing. In this state, there is no such thing as an ebike legaly. Just mopeds, that limits top speed to 25 mph. And for mopeds, I need a drivers licence. But the cops here are going to ignore me as long as I don't ride up the street on the wrong side, run stop signs etc. I'm sure they could give a shit if I went 35 as long as the street had that speed limit.
Back when we were kids, the loophole we used was that the irrigation ditch roads were not " Roads" so we could ride up and down them all day on dirt motorcycles with no problems. But we'd get ticketed right away if we tried to ride across a street when the ditch crossed a " road". We could cross pushing the dirt bike though.
The same loophole would apply I bet, to speed limits on bike paths, parking lots that are private property, etc. On our local bike paths, I have seen no speed limits posted, and there's nothing in the local ordinances either. In another state, that recognises an ebike and limits speed to 20 mph, then it would be 20 mph everywhere. That woud depend on the wording too, with some places saying 20 mph limit or whatever, and others may say 20 mph on level ground, implying higher speeds could be legal if you pedal for it, or are going downhill.
But when you go by the cop that's radaring the school zone, belive me, he'll ticket you for sure if you exceed the school zone speed. He won't care about the ebike, he'll ticket you if you blast through the school zone pedaling a big wheels toy trike or zooming on roller blades.