ZUOYING NAVAL BASE, Taiwan — The Hai Pao, one of Taiwan’s four navy submarines, began its service as the Tusk, an American vessel launched in August 1945 at the end of World War II. Its sister submarine, the Hai Shih, is a year older. Neither can fire torpedoes today, though they can still lay mines.

The submarines, said Feng Shih-kuan, Taiwan’s minister of national defense, “belong in a museum.”

The Hai Pao — with its paint-encrusted pipes, antiquated engines and a brass dial with a needle to measure speed in knots — will instead remain in service past its 80th birthday, a relic of a military that once was one of Asia’s most formidable. Taiwan’s aging submarine fleet is but one measure of how far the military balance across the Taiwan Strait has tilted in favor of the island’s rival, mainland China.

A military modernization overseen by the Chinese president, Xi Jinping, whose political power reached new heights after last month’s Communist Party congress in Beijing, has proceeded in leaps and bounds, lifted by hefty budget increases that have already made China the world’s No. 2 military spender after the United States, though it is a distant second.

Taiwan’s armed forces, by contrast, have fallen way behind, struggling to recruit enough soldiers and sailors — and to equip those they have. A major obstacle is that countries that might sell it the most sophisticated weaponry are increasingly reluctant to do so for fear of provoking China, which claims Taiwan as part of its territory. The unwillingness to anger China extends even to the United States, on which Taiwan has long depended for its defense.