hmmm … this is a tough one. As posted above, seems unlikely that pushing on the brake pedal would affect the start operation. Usually balky no-crank problems are caused by the transmission neutral safety switch (assuming you have an automatic, right?) or the starter motor itself. The neutral safety switch interlock is where you can’t start the engine unless the transmission is in P or N. There is another safety interlock between the brake pedal and the transmission in some cars, probably yours too, where you can’t shift out of Park unless you are pressing your foot on the brake pedal. So I’m thinking there may be some kind of weird interaction going on between the brake pedal interlock and the neutral safety switch interlock.
If replacing the starter doesn’t fix the problem, that’s where I’d look next. If it starats happening again, besides pressing on the brake pedal, also try slightly repositioning the gear shift lever as you try to crank the engine, sometimes that will work when the neutral safety switch is going out. Or try starting in N rather than P.
Hopefully the new starter will fix the problem and you’ll be left with a working car and a minor mystery.