American officials are hoping that the U.S.-Japan trade agreement on farm products signed here today will help dampen the fires of protectionism in Congress next year.

The agreement does not go as far as the Americans had hoped, and a last-minute effort to expand it failed as the negotiators appeared pleased to have gotten as much as they did before the next Congress convenes.

"With this agreement, we have taken a substantial step toward managing the protectionist pressures" which are rising in Congress, said Alan Wolff, the deputy special trade representative who led the negotiations.

The farm trade confrontation always was viewed in a political context by Wolff and his boss, Robert Strauss, who had considered concessions by the Japanese essential to their efforts to satisfy farm-state representatives in the United States.

Had the Japanese not been willing to give in somewhat on beef and citrus fruits, how could all of those Japanese Toyotas, Sonys and Datsuns continue to pour uncontrolled into American markets? Wolff asked today.

The agreement reached this morning after many hours of protracted negotiations will increase significantly the amounts of American beef and citrus fruits permitted into the Japanese market in the next four years.

The amount of high-quality beef will increase five times, bringing the total to 30,800 tons in 1983. Orange imports into Japan will be allowed to rise from 15,000 tons last year to 82,000 tons in 1983. Other increases will be permitted for citrus juices.

American insistence that Japan go further and agree by a certain date to open its market completely, eliminating all quotas for those products, is what caused the unexpectedly long talks in Tokyo Monday and today.

The Japanese thought they had settled that question in Geneva recently, where the rough formula for the agreement was worked out. They claim they refused then to agree on a timetable for lifting all quotas and thought the Americans had accepted their position until Wolff and U.S. Ambassador Mike Mansfield raised the question anew here.

Ichiro Nakagawa, the Japanese agriculture minister, adamantly refused to talk about it again here and told the Americans that if they continued to insist, they could prepare to deal with his successor. Nakagawa will leave office this week as new Prime Minister Masayoshi Ohira is sworn in and appoints a new cabinet.

Nakagawa told reporters the Japanese parliament never would have accepted an agreement which pinpointed the year in which all restrictions would be lifted.

For his part, Wolff said that the American delegation has "a clear expectation of an open-market situation" in Japan by 1984.

Farm-product imports have been a major issue in Japan as well as the U.S. Japanese growers insist their business will collapse if American imports are permitted to increase, and the growers have a disproportionately large representation in the Japanese parliament.

The agreement was written in a fashion to mollify them as much as possible. Most of the increased imports of American oranges will be permitted during only three summer months - June to August -- when Japan's home-grown oranges, called mikans, are not on the market.

Nakagawa told reporters today that the agreement would not damage Japan's growers, asserting that the added imports of beef and oranges easily could be absorbed by growing Japanese consumer demand.

In pressuring Japan for a maximum of quota relief, Strauss and Wolff were looking past the simple agreement on oranges and beef to what they foresee as a difficult effort to convince Congress to adopt the entire Tokyo Round package of tariff and quota cuts negotiated in Geneva.