The Federal Reserve and the Treasury announced steps Sunday to shore up mortgage giants Fannie Mae and Freddie Mac, whose shares have plunged as losses from their mortgage holdings threatened their financial survival.