U.S. farm trade ran in the red last month for the first time in 27 years as the nation's total trade deficit for May surged to $14.2 billion, the Commerce Department reported yesterday.

The trade deficit, which increased by $1.9 billion over the total for April, is likely to continue acting as a brake on the country's economic growth, economists said. The Commerce Department last week blamed the deteriorating trade performance for the country's sluggish economy as it lowered its estimate of first-quarter growth to 2.9 percent from 3.7 percent.

"The lousy trade numbers mean it is highly unlikely that we will get any relief on the trade front this year. It puts a dark cloud over forecasts for an economic rebound," said Jerry Jasinowski, chief economist of the National Association of Manufacturers.

The continuation of a high trade deficit, moreover, is expected to intensify congressional pressure for tougher trade laws, and some lawmakers and economists predicted the Senate will return in two weeks from its July 4th recess with a renewed determination to pass a trade bill.

The size of the deficit and the shift of farm trade into the red surprised many analysts because the dollar has declined by about 30 percent in the past 16 months, making American products less expensive overseas and increasing the price of foreign goods here.

"In the second half of the year, the effects of the lower dollar will help to improve the deficit," said Commerce Secretary Malcolm Baldrige. "However, a pickup in the pace of economic growth is necessary to bring world trade into better balance."

Senate Majority Leader Robert J. Dole (R-Kan.) called on the Reagan administration to take "a more aggressive approach" to farm exports in the wake of a $348.7 million trade deficit in agricultural products, a stunning turnabout from the days when American farmers dominated world markets.

"Something is radically wrong when the greatest food producer in the world is buying more agricultural commodities than it is selling," said Dole.

The last time the United States imported more farm goods than it sold overseas was in 1959, according to Agriculture Department analyst Thomas Warden.

Farm exports have decreased more than one-third since President Reagan moved into the White House in 1981. Deputy Assistant Secretary of Agriculture Ewen M. Wilson said the high support prices of Reagan's 1981 farm bill, along with an overheated American dollar, were responsible for making U.S. farm products too expensive in foreign markets.

"High support prices had a very dramatic impact on our ability to export over the past five years," Wilson said.

The May farm-trade deficit was caused by a decrease in exports of wheat, soybeans and other food grains that traditionally have dominated export sales. Wilson said some buyers held off their purchases in anticipation of lower prices this month.

He predicted that last year's farm bill, which as of June 1 decreased the floor on wheat prices from $3.30 a bushel to $2.40, and the cheaper dollar will help increase farm exports. But Wilson said lower corn prices don't take effect under the bill until September, and "I am afraid we are going to see disappointing corn sales until we get the new prices."

Other farm economists, however, doubt that the lower farm support prices and a decrease in the value of the dollar will provide much help to American farm sales overseas.

"This year has been particularly lousy for major grains. Exports have crept down each month. Russia hasn't bought any wheat since before February, and Brazil is growing its own, with a record high harvest," said Commerce Department analyst Gerald F. Kotwas.

"There are fewer places in the world to sell," noted David Wyss, chief economist for Data Resources Inc. "Most countries are now self-sufficient . . . and with the strong dollar we are getting priced out of the markets that are left."

He said that Japan and the Soviet Union are the only markets left that have any money. Major purchasers of U.S. grain, such as China and India, now are in the export market, and American farmers complain that they meet stiff competition in other countries from highly subsidized products of new exporters such as France and Argentina.

Dole, in a letter to Reagan released yesterday, warned that "if nothing is done to increase agricultural exports within the next two or three months, I expect pressures could build up to such a level in Congress that some legislative action will be taken."

"The administration may believe that a deficit in agricultural trade is acceptable, but I am sure that American farmers, suffering from a neglected farm policy, do not," said Senate Minority Leader Robert Byrd (D-W. Va.).

And Rep. Tony Coelho (D-Calif.) said, "Our farmers are operating in a situation worse than the dust bowl. Only this time, world markets are blowing away instead of just dirt."

While the major U.S. farm exports are grains, Americans buy large amounts of processed meats, seafood, fruits and vegetables from overseas, as well as coffee and sugar.

The May trade figures showed that overall U.S. overseas sales declined while, despite the lower dollar, foreign goods continued to pour into the country. "Foreign competitors are holding onto the U.S. market at all costs. They are cutting profit margins to the bone rather than give up U.S. sales," said the NAM's Jasinowski.

Once again, the United States ran its largest deficit with Japan, $5 billion, up from April's $4.7 billion. Other major deficits were with Western Europe, $2.7 billion, about the same as April; Canada, $2.2 billion, up $400 million from April, and Taiwan, $1.2 billion, up $200 million from April.