Prior to 2021, both Model S and X lose their accessory power as if it’s an old gasoline car with the ignition turned off. So when you press on the brake pedal, that simulates as if you just turn on a gasoline engine and supply the power to the windows.
I guess in 2021, Tesla figures it out that there is no need to simulate gasoline engine on/off for windows operations anymore.
Thus, to solve your problem, buy a newer year, at least 2021 production