You definitely did the right thing. She'd be way more humiliated if girls at school told her and potentially made fun. That would be way worse.
I think you definitely handled it properly. Better that her mom pointed it out than someone at school. Can you imagine her embarrassment if that would have happened? And then the guilt you would feel afterward for not having said something? She was going to be upset either way, but I think this way was the lesser of two evils. Good job!