As nice as you feel like you were, it may have caused even more problems for that little girl. Even though the parents shouldnt treat her that way, a one time speech to parents like that probably doesnt really help.
If that had been me as a child, I would have probably gotten a good yelling at in the car all the way home which would have worked my stepdad into a frenzy, causing he and my mom to fight over it and then resulted in a belt beating by him when I got home because i was whiney and loud enough in the store for others to hear which embarrassed him.
It was nice of you to try though.
Maybe another thought would have been to tell the little girl... i bet you will be having so much fun this summer that you wont even worry about what kind of suit you are wearing!
Or telling her that she has such a beautiful personality that the bathing suit doesnt change that. No matter what she is wearing, as long s it is with a smile, she will be gorgeous.
Just my opinion... since you asked.