We are probably going to need more information to give you good advice:
Assume your brakes are hydraulic over hydraulic 4 wheel disk brakes-- please confirm.
Assume that this problem only began after you worked on the batteries-- please confirm. If so, I would sure go over all the connections, including some of the smaller-gauge ones.
Does the engine quit (i.e. tach goes to zero) when this happens or does it just have reduced power?
The brake problem is a bit puzzling (assuming it is the system I mention). Even if the engine quits, you have an electric back up on the master cylinder to provide boost were the engine to stop. This is boost only-- totally separate from the brake hydraulics. The fact that you have to pump the brakes suggests that the brake (vs boost) portion of the system has a problem. Problem could be bad master cylinder or air in the system. Can't see how lack of boost would give you a soft pedal where you have to pump to firm up.