It's part of the shape of the universe.
You can try threats and rewards, but the truth is school sends letters home, but don't seem to tell the girls off for undoing their hair.
They undo their hair and the older ones redo their hair in Friday assembly, no one says anything.
Neither of mine has ever reported primary school actually caring if their hair is up.
It's a phase that only lasts a year or two, then they learn to plait their own hair and you have no idea whether it was tidy at school or has been done two minutes ago to shut up moaning mothers.
Senior school does PE gives out detentions if you don't tie it up.
U tube has lots of good videos of hair styling, DD2 loves them and so do I.
She loves copying them and now twists her hair neatly back from her face (no amount of nagging from me had any effect at all). Also she lets her big sister do the complicated ones and they are really sweet together. Normally big sister isn't cool at all.