Normal ship cannon shells are smaller than normal artillery shell used today.
The yamato or new yersey shells could be intercepted by the CIWS system as they are big as bombs/missiles. However. the CIWS is very unrelyable regarding operationality. That's why the navy is switching to the german/us Ram missiles.
If you have ever seen us navy ships doing lifefire exercises you will notice that they do no better than normal artillerists despite all their realtime sensors and computers (against non-moving ships!). An artillerist with a good observer could do better.
True nowaday subs are more silent but that advantage depends on speed. At 20kt a sub is as loud as a band no matter what. Besides all ships use active sonar so it doesn't matter if a sub is silent or not.
And note that the japanese torpedoes were the most advanced at the time. Only the germans with their zik-zak seeking torpedoes could compete.
Of course there is no WW2 ship that could escape an ASCAP.