Well, they may not be. Just do a little research by googling the melons name and Hermaphrodites.
And if they are, it doesn't mean that they are sterile, what it would most likely mean is that you don't have a pollinator visiting your plants. Therefore, you would want to figure out how to attract pollinators like:
Planting other flowers to attract beas, syrphid flies and so on.
One thing that I think that every gardener should do is hang several syrphid fly homes around their garden.