The government's main gauge of future economic activity rose 0.7 percent in May after two months of declines, suggesting that Federal Reserve Board action earlier this year to pull the economy out of its slump finally may be working.

However, Commerce Secretary Malcolm Baldrige cautioned that the increase in the index of leading economic indicators wasn't sharp enough to suggest the economy will grow at the rate anticipated by the Reagan administration. Estimates of the federal budget deficits assume the accuracy of those anticipated growth rates, and if the economy falls short of the targets, the budget deficits will be larger.

A second report showed that the merchandise trade deficit widened last month to $12.67 billion, the second-highest monthly level ever, and Baldrige said yesterday that the 1985 trade deficit will be between $140 billion and $150 billion, exceeding last year's record of $123 billion.

The continuing deterioration in the trade sector has been blamed as a major factor in the economy's sluggish pace in the last year. The Fed has pursued an easier monetary policy in recent months in an effort to lower interest rates and revive stronger growth.

The Commerce Department reported that the index of leading indicators rose nearly across the board, after a 0.6 percent decline in April and a 0.1 percent drop in March, which made many economists worry about the economy's health.

Although economists yesterday said it appears that a rebound is under way, they said it will be less than dramatic and that growth will still be far below the 4 percent anticipated by the Reagan administration.

The increase in the index of leading indicators "is welcome news as the gains were widespread and offset the declines in March and April," Baldrige said in a statement. "Over the past six months, the leading index has risen an average of 0.3 percent per month. As a rough guide, we need sustained increases of about half a percent per month to maintain economic growth at a 4 percent rate."

The economy grew at a 0.3 percent rate in the first quarter and by an estimated 3.1 percent in the second quarter, which ends tomorrow. For the administration to achieve its goal of 4 percent growth for the year, the economy would have to expand at a 6 percent rate in the third and fourth quarters.

Few economists are predicting such a strong pickup in activity; instead, they expect growth between 2.5 and 3 percent for the year. Economists said yesterday, however, that the Fed's easier money policy and the recent decline in interest rates were reflected in recent economic statistics pointing toward improved economic activity.

"The upturn in the leading indicators along with other recent developments, such as the fall in the prime rate, suggests that the economy will pull out of its slump by the latter part of the year," said Jerry Jasinowski, chief economist for the National Association of Manufacturers. "It is particularly encouraging to note that the rise in the indicators was broad-based and therefore cannot be dismissed as the influence of isolated factors."

However, Jasinowski added, "We still expect a mediocre third quarter," followed by a pickup in the fourth quarter.

The index of leading indicators "is probably telling us what it's been telling us for a year or so, we're not going anywhere," said Ed Warren, an economist with Chase Econometrics. "The Fed's efforts kept [the index] from going down three months in a row. The expectation is that [the Fed's action] will at least prevent the economy from slipping down."

Increases in the indicators were widespread; eight of 10 indicators contributed to the rise. The positive indicators were change in sensitive materials prices; average work week; money supply; stock prices; building permits; contracts and orders for plant and equipment; average weekly initial claims for state unemployment insurance, and manufacturers' new orders for consumer goods and materials.

One indicator, net business formation, declined. The 10th indicator, vendor performance, which measures the demand for goods by gauging the speed of deliveries from vendors, was unchanged.