Saying boys are better at maths, is an incorrect statement. It's not calling the op, or girls in general, stupid. Intelligence isn't something that is one attributed to one subject.
A 9 year is unlikely to think of it that way. That's why it's the OPs job to challenge what he is saying and make sure he thinks about what he is saying fully. Rather than repeating something he has heard and assuming it's fact.
It's her and her Dps job to make sure he doesn't believe everything he is told and that he understand the implications of what he says.
I also think we can shield kids to much from sexisim. We live or lives and challenge our kids when they repeat sexist statements. But I don't think many people discuss the impact sexism has on women. I think many kids believe that because women/mothers can work, can go to university, go to the same schools, get the same lessons etc that sexism isn't relevant anymore and it does really exist.
So it's not something they think about too much. I talk to my Dd about how sexism presents today, how it's damaged women, families and society in general. If something sexist happens to me, I talk to her about it.
I do with Ds too, but to lesser extent because of his age. We can't have the indepth discussion that Dd and I have. Dh also does this, which is important.