Svein,
If the motor still tries to run with the brake levers held in, and the battery LEDs lighting have stopped working, then I would say the fault will be somewhere along the black ground wire, as a poor ground connection would cause this exact problem.
Double check that all the joints are good at each connection to the black wire where it links across to each of the other items that share the same common ground. (pedelec, brakes, cruise, LED light supply etc.)
Alan