President Reagan, in a surprise reversal of his earlier tough line on trade with the Soviet Union, announced yesterday that he is ready to negotiate a new long-term agreement to sell American grain to Moscow.

Reagan's decision, communicated to the Kremlin two weeks ago, means that U.S. trade negotiators are free to meet with the Soviets, assuming that the Soviets are willing, to work out a multiyear extension of the present agreement.

Under the current extension, which expires Sept. 30, the Soviets are expected to buy slightly more than 6 million metric tons of U.S. grain, the minimum required. But since 1981, after former president Jimmy Carter imposed a partial embargo, Moscow's purchases have declined steadily from the 1980-1981 peak of roughly 23 million tons.

And as Reagan has refused to negotiate a new long-term agreement, the Soviets have turned to Australia, Canada, Argentina and western European countries to meet grain import needs. American farmers, meanwhile, have complained that the president's hard line was impairing the U.S. farm economy.

Administration officials explained Reagan's change of heart on the long-term agreement, which he had refused to negotiate for two years, as a recognition that his earlier objections had "made their point" and were no longer valid.

The president's decision in 1982 to limit the current extension to one year was based on his displeasure with Soviet involvement in martial law in Poland.

Although tension continues in Poland and the president has stuck to a hard line with the Soviets on issues such as nuclear arms and military expansion, U.S. Trade Representative William E. Brock declined to specify why Reagan had abandoned his past objections to a long-term grain pact.

Brock said the past refusals "simply had no validity as a tool in that capacity any more . . . . We believe this sanction has made its political point."

But Deputy Agriculture Secretary Richard E. Lyng conceded that the administration's refusal to extend the agreement had pushed the Soviets to turn increasingly to other countries for grain while American surpluses mounted and farm exports lagged.

"From an agricultural standpoint, we have lamented seeing this moving to the Argentines . . . and others," Lyng said at a White House briefing. "By having a long-term agreement, we think we can regain at least a portion of the volume we had before."

And Reagan had been under growing pressure from Agriculture Secretary John R. Block, Republican farm-state legislators and farm groups to renew the long-term agreement with Moscow as a way of demonstrating U.S. seriousness about being a reliable supplier.

Grain-state Sens. Robert J. Dole (R-Kan.) and Charles H. Percy (R-Ill.), for example, have 46 co-sponsors on their pending Senate resolution calling on the administration to seek a long-term sales arrangement with Moscow. Dole said yesterday that Reagan's decision is "an extremely important step in restoring the reputation of the United States as a reliable supplier to this important market. I hope the Soviets will respond positively."

Another grain-belt senator, Larry Pressler (R-S.D.), said the decision was "a significant shift in adminstration policy with more emphasis on the farm economy . . . . The Soviet Union is a major grain importer and we must aggressively work for this market."

House Agriculture Committee Chairman E (Kika) de la Garza (D-Tex.) applauded Reagan's move as "a sound decision that comes at an appropriate time and, I hope, can lead to a badly needed increase in exports of American grain."

The U.S.-Soviet grain trade has been in turmoil since early 1981 when Carter imposed his partial embargo as punishment for the Soviets' December, 1979, invasion of Afghanistan. Carter banned them from buying any more than the minimum amounts prescribed in the long-term agreement.

At the time, United States grain sales were running at a rate of roughly 23 million metric tons per year, which represented about 75 percent of the Soviets' overseas purchases. Today, U.S. grains account for only between 20 and 30 percent of Soviet purchases.

As a presidential candidate in 1980, Reagan campaigned in the grain states against the embargo and pledged to lift the sanctions once he was elected. He did not do so for nearly a year and a half, but then he suspended long-term agreement negotiations to penalize the Soviets for their involvement in Poland.

At least one member of Congress, Rep. William V. Alexander (D-Ark.), read the presidential decision yesterday as a blunt political move.

"For whatever reason, it's good news," Alexander said. "It means the president has approved a fundamental shift from pointless belligerence. And it probably means he has decided to run for reelection in 1984."