That would only cause a demographic difference if STEM was more likely to the boy's one area they scored highly at compared to girls.
If the only difference was that girls were good at more subjects, but the distribution of subjects both genders were good at was equally distributed across subjects, there would be no net effect.