If they work normal for a while then just quit at random, you can bet it's the pressure switch. The reason is without the pressure switch functioning to control the on/off cycles off the pump, then the pump motor run until its thermal cutoff shuts it off for a while until the motor cools down. It is during this period the system will be depressurized and your pedal will be hard and you'll have no rear brakes.
Good luck.
PS You'll also want to replace the pump motor relay over in the passenger side firewall area of the engine compartment if you replace the pressure switch.