Until the late 1400s, the word meant a child of either sex.
Schools were segregated in France until the end of World War II.
The word girl is sometimes used to refer to an adult female, usually a younger one.
This usage may be considered derogatory or disrespectful in professional or other formal contexts, just as the term boy can be considered disparaging when applied to an adult man. It can also be used deprecatively when used to discriminate against children ("you're just a girl").
One notable exception to the general neglect of girls' literacy is Queen Elizabeth I.
In her case, as a child she was in a precarious position as a possible heir to the throne, and her life was in fact endangered by the political scheming of other powerful members of the court.