The U.S. Navy is carrying out the biggest overhaul of its top-secret undersea surveillance network since the 1950s as China’s naval power surges and new technologies are fast reshaping maritime warfare. Beijing has similar plans of its own.