It wasn’t killed by foreigners, it was killed, just like the railroads, by the interstate highway system and trucks. We don’t need 150 piers and train freight/ferry terminals in NYC because we can stage trucks from a limitless number of truck terminals. Less capital cost, less labor, less wasted inventory, less chokepoints (key infrastructure, unions, etc). The guys who operate the Staten Island ferry make as much as 5-7 bus drivers.
You need a smaller number of large players with multimodal integration. Containers, tankers and special purpose for oceangoing and tugs/barges for near water.
The Navy is at risk because our defense procurement infrastructure is tied to the nostalgia of old admirals with dreams of fighting WW2, and struggle to identify the next thing. The main viable warships afloat are submarines and the capacity to grow that is in such a sorry state we basically keep the yard running.