Guns and barrel diameter, I suspect, are not the deciding factor. Some 5 inch projectiles are rocket propelled and can go much further than your typical 5 inch gun.
And the Standard missile has a surface to surface capability: Imagine a ripple of a dozen of those coming at the Chinese Destroyer at Mach 3+.
The gun tubes on the two ships are irrelevant to the outcome of this particular type of event.
In pawn vs rook, the pawn’s side wins if they take out the rook.