It not only “can” be left out, but it “should be” left out.
What other medium would we be considering it to float or sink in? Air? Alcohol? Of course we’re only interested whether a seagoing ship sinks in water or floats on it. (And “liquid” water, too. We already understand that it will never float on water vapor, and it will probably never sink if it’s placed on enough ice.) Don’t confuse readers with too much detail that won’t aid their understanding.
If there are different buoyancy characteristics of a vessel in fresh water vs. seawater, or if temperature, acidity or other characteristics of the “water” medium matter, then those should be mentioned – if it’s vital to the context of the work. For example, a scientific study of marine engineering / naval architecture should include very fine and exacting detail about the water, but a story about “Thomas the Tugboat” ... not so much.
But as long as we’re talking about actual seagoing ships, the medium that everyone on Earth is already familiar with is whether the ship floats or sinks “in water”. That much can be left out.