Two easy things to check which the others pointed out, but just to make it clear.
You know about the stupid red button on the throttle which is too easy to accidentally press when you change gear, and it switches off the motor?
When you pull the brake levers they operate switches that cut the power. Sometimes a lever or switch gets stuck, which keeps the power off. Push the levers fully out to see if that releases the switch.
One other possibility: If you follow the wire from the motor behind the frame, there's a hidden connector. Mine was in heatshrink sleeving, so not easy to see or get at. Try pushing both sides of the wire inwards to make sure that the connectors are fully home.
After these things, you need a meter to find the problem.
Let us know how you get on.