Brake fluid (At least some of the formulas) are/is Hydroscopic
This means it sucks moisture out of the air, like salt.
Now, if the brakes get hot enough, WATER (Moisture) Boils turns into steam.
Unlike liquid, STEAM, can be compressed, rather easily.. And the pedal goes to the metal.. Sounds like this is what happened to you.
So the advice to flush the system and put in all new brake fluid.
Very good advice.
And have them inspect the rest of it while at it.. Whow knows...
True story follows: Got sued once for neglance causing an accident.. WAS PREAPARED when we went for the deposition.. They settled for the damage to the car my wife hit, actually, a bit less than that (Like 3 grand and change).
What happend.. A brake pad went AWOL as wife was approaching a red light., There being no where to turn to she hit the car in front of her.
Following up,, I removed the wheel with the defetive pad in the presence of two mechanics, both of whom observed the missing pad.
I still had the box the brake pads came in with the register tape stapled to the box.. Took that with me to the shyster ambulance chaser Kentucky Coronal of a lawyer's office for the deposition.
They settled out of court. One of the smallest settlements of that kind the insurance company ever paid.
And to the aforementioned lawyer.. If you perhaps should read this.. NOTE that I have not given your name or address.