Firstly, want to establish whether or not it's even true that there was a time when grown women (almost) always wore their hair up (in public) v. girls that might/often wore their hair down. I get this impression mostly from movies/books regarding middle-to-upper-class 19th century women in England, Canada, and United States. So I'm not really asking about time before that, but whether there was a transition in the 19th-to-20th century or early 20th century?
Certainly, I know the bob was worn in the 1920s. And I can't really think of a time after when hair was always worn up in public - at least not in movies from the 1930s and 1940s. Was it ever that way in the 1800s, or do I just have a false impression?
While the style for hair was long in length, it was kept up. This prevent tangles, dirt, smoke, and other general dirtiness. It's the same reason caps were worn in the 18th century and continued to be worn by certain occupations to this day (surgeons, cooks, etc), you don't want hair in your work or work in your hair. Children often had shorter hair, at least up until a certain age. Much of history they too would have worn caps or other coverings, though that was less fashionable in the 19th century. You will still find them with styled hair, even if it is just braids, to prevent the tangles and dirt.
You noticed that there was a major shift in the 1920s. Women were wearing their hair down because it was cut short. You still won't see the fashion for wearing long hair loose until the late 1960s. Prior to this is was still styled, whether in an up-do or by setting in curls and waves. The early 20th century is also when there was a major advertising push with shampoos. Women still only washed their hair occasionally through most of the 20th century. Often getting their hair set once or twice a week, and washing was usually involved in that.