There are going to be two effects. The first is a very large upward moment directly beneath the ship at the point of explosion, followed soon after by a downward moment when the explosion void is filled by the water and everything around it is pulled inwards to fill the vacuum.
The upward hit should actually be easier for a ship to resist because there is only air above the ship and it is “relatively” easy to lift the ship out of the water and into the air, but the downward pull means the ship is going to be pulled against the water and that will not move out of the way as easily or as quickly as the air. The second effect is what leads to the most damage.
The way I was taught this is that the strongest force and impulse (integral of a force over the time interval) is upwards after the explosion. The ship is already structurally destroyed at this point. Nothing works even if the ship does not immediately sink. When the ship falls donwards is when the keel breaks, hull breaks and water gets in. Any subsequent oscillation can cause more damage.
I know this is actually very important and interesting in the context of understanding how to build better ships/torpedoes, but I'm just imagining two seamen clinging to debris arguing on the exact mechanics by which the torpedo blew up their ship.
Proximity detonation breaks the ship from the force the gas bubble directs upwards.