There's 2 little wires that are covered by a rubber boot. Unplug those and see if it still happens. Sounds like one of the wires is grounding out and killing the bike.
I have a few Ciao's that have this problem. I just disconnected those - who needs a brakelight anyways =)