When you wrote 'out of the car window', I assumed you meant outside. In that case it might have been a warning (if the overheated car came to rest in a dangerous place - say at a blind corner). People often use a bit of material (any colour) to mark a load sticking out from a vehicle - for example, a ladder, or a piece of furniture sticking out of the back of a hatch-back, so a handkerchief fluttering from a passenger window might be a - not very - effective - warning.
But from the context, I imagine the car window is just a convenient way of keeping the handkerchief always to hand (inside the car).
- For Teachers