It sounds to me that at least one of the rear
wheel speed Sensors is bad/not reading the rotation speed of the
wheel, so for safety sake (I know, it sounds counter intuitive) it shuts both ESC and the EPB off. Most cars use the
wheel speed sensors for traction control, electronic stability control, brake force distribution and of course, the Anti-lock Braking System. If one of those speed sensors at the rear stops working, the module no longer keeps control of the line pressure to modulate the brakes since it can no longer read the
wheel speed. With our cars, the Traction Control, EPB, ABS, and ESC are tied together. So when you see ESC light up for no reason, it could just be that the Traction Control isn't working, or the Traction Control is working but the actual Brake force distribution circuit has stopped working so the system won't intervene if you're about to fishtail/spin out/understeer etc. I've had this happen on my last 2 cars, the
wheel speed sensor got gunked up with snow and the system couldn't read the
wheel speed anymore. I still had ABS, but no traction control and no Electronic Stability Management. Took the car to the car wash, sprayed the underside and cleared out the snow from the
wheel area and magically it was all good again.
So, I would start with the rear
wheel speed sensor since it's also effecting the Electronic Parking Brake.