President Reagan is caught in an election-year tug-of-war among his top advisers over legislation that would require subsidized U.S. grain sales to the Soviet Union and China, an issue that will force the president to choose between domestic and international politics.

The House Agriculture Committee, following the lead of the Senate last week, yesterday approved by voice vote a bill requiring such sales. The vote came as Australian Prime Minister Robert Hawke warned that the legislation would have "devastating implications" for his country and call into question U.S. leadership of the Western world.

Australia is a major grain exporter and likely would lose foreign sales because of subsidized U.S. exports.

Reagan's top advisers are sharply divided on the issue, with Secretary of State George P. Shultz, Secretary of Defense Caspar W. Weinberger and other foreign policy officials strongly opposed to the subsidized sale and Secretary of Agriculture Richard E. Lyng, Secretary of the Treasury James A. Baker III and domestic political advisers backing the sales to help U.S. agriculture and aid GOP lawmakers facing close political races this fall in the Midwest grain belt.

The officials laid out their differences at a White House meeting with the president on Monday. A senior White House official said the foreign policy advisers "made a good case" in the meeting but that "the political logic" on the other side was "pretty hard to refute." The official said control of the Senate next year might be affected if the issue is mishandled by the Republican administration.

Reagan already has the power to order the subsidized grain sales under the 1985 farm bill, but has taken no action. The pending legislation in being used by supporters in Congress to pressure him to do so. The White House said Reagan had made no decision on the question as of late yesterday, and a spokesman said none is expected today.

The issue erupted on July 22 when a Senate coalition led by Majority Leader Robert J. Dole (R-Kan.) attached an amendment to a funding bill for the Export-Import Bank requiring the subsidized sales.

One of Dole's cosponsors was Sen. James Abdnor (R-S.D.), who faces a tough race for reelection against Rep. Thomas A. Daschle (D-S.D.). Last Friday, Daschle introduced a more sweeping version of the subsidy plan, which was adopted yesterday by the Democratic-controlled House Agriculture Committee on a voice vote. An aide to Daschle said House Democratic leaders may bring the bill to the floor next week.

Shultz, calling the Dole plan "ridiculous," said last Friday that the measure would subsidize the Soviet Union in violation of an agreement with U.S. allies. He also expressed concern about the impact on Australia, a key U.S. ally in the Pacific.

Australia is particularly important, and Hawke's Labor government is in a sensitive position since Washington excluded New Zealand from the ANZUS (Australia-New Zealand-United States) alliance because of its refusal to allow port calls by U.S. nuclear-armed warships.

Hawke predicted dire effects of U.S. subsidized sales in a letter to about 50 members of Congress released by the Australian Embassy. He said application of the U.S. subsidies to wheat sales to the Soviet Union and China, Australia's two top wheat customers, "would inflict critical damage on the well-being of all Australians."

Hawke said the "price war" brought about by the proposed U.S. subsidies would cost Australia about $280 million in export revenue.

He also said that subsidizing the Soviet state at the expense of "America's friend and ally Australia" would inevitably cause questions "about America's commitment to its leadership of the West."

A team headed by Minister for Agriculture John Kerin is to arrive in Washington today to make Australia's case with the administration, Congress and the U.S. public.

Staff writers Lou Cannon and Helen Dewar contributed to this report.