Manufacturing activity in the world’s two largest economies perked up in March, an antidote to financial-market fears of a coming global recession, though pockets of weakness remain and the outlook is uncertain.

Gauges of the U.S. and Chinese factory sectors stabilized last month from earlier slowdowns, sparking a rally in U.S. stocks after investors had braced for weaker readings. Investors, in turn, sold off supersafe government bonds, sending yields on long-term Treasury bonds above short-term interest rates Monday. That...