Answer : It’s a float for a tank vent for a large ship.
A common one is gooseneck style but it can be a lot of different styles.
If that vessels tank vent becomes submerged for some reason that ball floats and caps the vent to stop water from going into the tank and down flooding the vessel.
It’s stainless because of corrosion resistance.