When exactly do you experience the pain? Are you forcing the Valsalva maneuver?I always try to make Valsalva on the surface after this happen. Usually I can't feel my eardrum "moving", so I assumed that it wouldn't work underwater?
By itself, water entering the external ear canal isn't enough to lead to difficulty equalizing. It's likely that you have an underlying condition that makes it harder to equalize. A good ENT should be able to test the function of your Eustachian tubes (see the diagram that @uncfnp posted) and determine the cause of your difficulty equalizing.
Best regards,
DDM