sounds like an allergy to possible the water, the material his bathing trunks are made from .it should disappear...ask the doctor if some hydrocortisone cream would be okay on that area ...
He may have had a slight reaction to the chlorine or if it was the beach sand probably rubbed him a bit. He could also have slight thrush. If he continues to complain take him to the Drs hope this helps take care
If he was swimming in a lake or pond, he could also have gotten a rash from algae in the water. In Seattle there is a well-known skin condition from swimming in Green Lake called "Green Lake Itch."
I'd run him to the pedi and see what's what.