Actually. In many types of sport boys are better than girls if you see speed and strength as the hallmark of what constitutes best.
It's a biological fact. It's why there's so much furor (rightly) about transwoman competing against woman.
So if a male is beaten by a female it is unusual. Kids will see this. I doubt at 9yo they realise the biology of puberty affecting it and at 9 it hasn't quite set in yet.
But between the ages of 9-12 girls are often "better" at sport than boys.
By 14 boys are generally stronger and faster as they've had their testosterone increase which affects how their bodies work.
I'd have thought this was an ideal time to have a really good talk with pupils and a discussion.
I don't think the comments as such are 100% nice and can be used as an insult and a small consequence could be necessary dependent on context.
But really harsh punishment without any explanation or context or discussion or even understanding of why it's not ok do nothing
to teach someone. It seeks to silence them.
And I'm actually not bothered with this type of comment being bourne from misogyny. It never harms for males to realise woman can be just as good or better than them and to comment out loud on it. The more they realise it the better imo!