The same function as all pre radar AA guns:
Put up a wall of lead around the ship which will splash anything trying to drop a bomb or a torpedo.
Not very subtle but surely effective
I noted the Russians/Soviets preserved a lot of WW2 guns and other ship parts, like the Turrets from the Cruiser Kirov (the WW2 one, not the nuclear one).
But navies are build from tradition, so if you can't save the ship, you save a part of it..