Sounds like the switch is up the swanny.
Just check to see if the thing is sticking by pulling and releasing the brake lever. you should be able to hear the switch clicking on and off. Don't need the ignition on for this as it's a mechanical switch.
Sometime just giving them a good squirt with WD40 can bring them back to life.
If the switch is indeed to blame then replace it. they're not expensive and it's only held in with one screw so a breeze to change.