I recall reading material attributing this to differences in biological development during teenage years which are relevant not only to sexual characteristics but for general body&mind&behavior changes and gender/hormones influence not only the type of changes but also their timing - so adolescent girls are not exactly equivalent in development to adolescent boys of the same year/grade; asserting that they are slightly more "psychologically mature" (or more adult-imitating/conforming behavior?) which affects study performance in adolescent years, and the boys 'catch up' a bit later. However, I'm not certain if this material I read has a solid evidence basis or is driven by speculative stereotyping.
The difference could very well be biological (although some would call that "structural sexism" as well).
But it would be interesting to test.
There is no evidence that proves that girls do better than boys.
Here from PISA [1]
Also APA [2]
It's the same story across cultures, after kindergarten, most girls accelerate past most boys in languages. Boys are generally a little bit ahead of girls in math.
[1] https://www.researchgate.net/publication/342344680_Examining...
[2] https://www.apa.org/news/press/releases/2018/09/girls-read-w...