Hmm... sounds like either the master cylinder, or the brake booster is having a random problem..
If you shut the car off with the brake pedal applied, then does it do the same thing, or just remain a high and hard pedal?
If (while the car is off) the brake pedal falls, then i think that the primary piston cup in the master cylinder is leaking, causing
brake fluid to escape, causing the low pedal, however, for it to drop, then return in pedal height sounds odd. If (while the car is
off) the brake pedal stays at it's regular height (or higher) than i think there is an air leak at the Brake booster check valve. While
the engine is running, engine vacuum helps build up assistance for the brake booster. If the check valve was randomly failing, then
you would momentarily loose that power assist, causing the brake pedal to drop, then rise again.