I have heard of a common failure being the brake pressure switch in the master cylinder, which monitors the pressure in the fluid when you apply the brakes. I would suspect this has packed up. Not hard to fix really.

HTH