Schoolgirl spanking stories aren’t about real schoolgirls, then, or about young women who are actually of school-going age. If that was the point of that fantasy, then it would be a pedophile fantasy, at least in media terms.
Pedants might point out that strictly speaking it’d be a hebephile fantasy (that is, about people who’ve recently passed puberty) and even then it wouldn’t necessarily be hebephile in clinical terms, since that requires a primary or exclusive attraction to that age group. But the clinical definitions aren’t really the point: the point is about ick and squick factor.
But the “schoolgirl” in those stories – even more so in roleplays – is an adult. Even if the story makes her improbably ignorant and inexperienced sexually, she’s not underage. But the stories do stress one thing about the age of the characters, and it’s clear that it’s part of the hotness of the scenario: the schoolgirl is younger than the teacher. She’s physically mature, but he has knowledge and power that she doesn’t have.
So there’s definitely an element of age play in the scenario, because the “teacher” may have to play older than he or she is, and the man or woman taking the “schoolgirl” role will generally play it as younger than they really are. They have to if they want to play as sexually naive as the “schoolgirl” character usually is. After all, someone who’s doing bdsm-themed roleplays probably isn’t all that naive.
In some versions of the naughty schoolgirl scenario, the schoolgirl is “the school slut”, and sets out to seduce the teacher. In that version the real person wearing a little pleated skirt for hotness’s sake is a sexually experienced woman who is playing the role of a younger sexually experienced woman who is playing the role of a virginal girl. Complexity is hot, of course.
It’s the combination of age-related ambiguity and non-consent that makes the schoolgirl spanking scenario edgier than it seems.