American farm exports could rise to between $35 billion and $40 billion in the marketing year beginning Oct. 1, leaving the U.S. with an agricultural trade surplus of $20 billion or more, the Agriculture Department predicted this week.

Large new purchases of grains by the Soviet Union, which has been hit this year by serious crop failures, will be responsible for much of the increase in exports.

The department's World Food and Agricultural Outlook and Situation Board also forecast that exports this year would hit $32 billion, up from $27.3 billion in 1978. Last year, agricultural imports totaled $13.9 billion, and this year are forecast at $16.3 billion.

The board cautioned that "it is still early to forecast 1979/80 exports precisely" because of uncertainties in transportation capacity and weather. Nevertheless, the board now expects at least 45 million metric tons of farm products to be sent abroad.

A metric ton contains 2,204.6 pounds or, for example, about 39 bushels of corn or 37 bushels of wheat.

The largest increase in exports will be in feed grains, such as corn used for livestock. The board expects such shipments to rise by about 10 million tons from this year's total of 61 million tons. Wheat exports should go up about 6 million tons, from 32 million this year.

Besides the Russian purchases -- which already have helped to push farm prices up sharply this year -- the board listed several other reasons why it believes exports will increase substantially. Livestock production is rising steadily in some U.S. markets such as Eastern Europe and Japan, and thatmeans more demand for feed.

Continued economic expansion in the fast-growing developing countries will add to demand. While relatively little growth in agricultureal production in the poorer developing countries will also mean more demand to the extent such nations can afford to buy or else receive aid.

Finally, the board believes "logistic problems" in major competitor countries -- including Canada -- likely will limit their exports in the coming year.

Meanwhile, U.S. imports are forecast to rise next year slightly above the $16.3 billion estimated for this year. Meat imports, which are up about 15 percent in volume and 62 percent in value this year, should rise further. Imports of coffee, fruits, vegetables, sugar and rubber also are forecast to be higher.