But the child wasn't commenting on the man's body.
He didn't say "why does that man have wobbly/big/small/hairy bottom"
He didn't say "why doesn't that man have any hair?"
He didn't say "that man is fat!"
These are all moments you teach a child that we don't comment on other people's bodies because it is rude, and sometimes unkind.
He commented on the man's clothing choice. Not what his bum was like, but merely, that it could be seen.
This is much more like saying:
"Why is he dressed like a parrot?"
Which, if someone is dressed in a parrot costume, isn't a rude or unkind thing to say at all, but a legitimate question.
"I can see his bum" isn't an observation that I would chastise my child for.
It's quite right that we should not expect to see a person's bum out, that this is actually a social boundary they have crossed which other people of any age are perfectly entitled to comment upon.
I'd go so far as to encourage my child to let other people know if they are able to see parts which should be private. For people who aren't vulnerable (eg other men vs women with children) it's practically a civic duty to say "oi mate everyone can see your bum that's disgusting". In my ideal world, that man would hear that 10 or 20 times every day and sort himself out as a result.