Congress completed final action last night on a new five-year farm bill and a separate rescue package for the Farm Credit System and sent both to the president.

President Reagan is expected to approve the credit measure, which could lead to federal aid for the ailing FCS, but the administration was giving few hints about the more controversial farm bill.

House and Senate farm-bill conferees fell about $2 billion short of Reagan's goal of a $50 billion limit on farm-program spending over the next three years, although they adopted some of the major policy changes sought by the administration.

Aides refused to discuss Agriculture Secretary John R. Block's position on the bill, but White House officials said Reagan is receiving conflicting advice on whether he should sign the measure.

Some advisers are urging him to veto the bill over various policy aspects rather than its cost.

Sources said the president probably would sign the legislation while making strong objections to some policy provisions, reportedly including sugar, dairy and export subsidies.

Congressional farm-state leaders were optimistic that Reagan would approve the bill reluctantly. But Rep. Edward R. Madigan (R-Ill.) again underscored the political dimension that has hovered over the debate all year long, saying, "A veto would be a disaster for Republicans in the Farm Belt."

Madigan added that electoral reaction in crucial House and Senate races next year could engulf even those Republicans who had distanced themselves from Reagan's calls for more austere farm programs.

The House approved the farm bill, 325 to 96, and returned it to the Senate, where it promptly became snagged in a Democratic-planted rhetorical briar patch.

None threatened to block adoption of the conference report, but one farm-state Democrat after another took the Senate floor to denounce the measure as inadequate medicine for the worst farm economic crisis since the Great Depression.

"The entire economy will suffer if nothing is done to help the farmer . . . . At best, this is a hold-the-line measure that will help buy time for agriculture," said Sen. Edward Zorinsky of Nebraska, the ranking Democrat on the Agriculture Committee.

"But it is far better than the complete turnaround sought by the administration, he said."

Others echoed Zorinsky, but the Senate then voted its approval, 55 to 38, and sent the bill on to the president. Opponents included Zorinsky and 13 Republicans.

The long-gestating bill, containing 18 titles that range from income supports and conservation to food stamps, agricultural research and exports, calls for a major shift in federal policy on basic farm commodities.

The bill generally would drive down commodity price-support floors in an effort to make U.S. farm goods more competitive overseas, while maintaining income subsidies to farmers near the current levels.

Lawmakers agreed on lower price supports sought by the administration for wheat, corn and other commodities, but lengthy debate erupted on the issue of income supports to carry farmers through a "transition" of regaining lost export markets.

The administration argued for a one-year freeze on income supports, also known as deficiency payments, with later reductions, but the conferees settled on a formula that amounted to no more than a 10 percent cut over the next five years.

In another bow to administration demands, Congress agreed to cut dairy price supports but not as abruptly as the White House wanted in its drive to reduce surplus-purchase costs that will exceed $2 billion this year.

Earlier yesterday, the House gave voice-vote approval to an FCS rescue package that had whizzed through both chambers on an unusual "fast track." That was aimed at bolstering investor confidence in the FCS, which holds about one-third of the nation's $214 million agricultural debt.

The credit measure orders reorganization of the FCS, the nation's largest farm lender; gives the federal Farm Credit Administration more regulatory power, and would open the way for federal aid to prop up the FCS if its assets are insufficient.

A key feature in the bill is creation of a capital corporation within the FCS network that would oversee reallocation of system funds from healthy to needier districts and administer federal bailout money if required as a last resort to keep the system whole.