After two days of turf fights and furious political maneuvering, the Senate agreed yesterday to take up a controversial bill next week that would confer sweeping antitrust immunity to the operators of American cargo vessels carrying freight on international routes.

The bill would permit American operators to participate fully in international rate-setting cartels known as conferences, and to set uniform rates for carrying cargo to inland destinations, without fear of antitrust action.

It would also allow "shippers councils," or groups of manufacturers and freight forwarders who use international vessels, to make agreements with the ship operators and with each other without antitrust restriction.

As part of a complex deal arranged by Majority Leader Howard H. Baker Jr. (R-Tenn.), Sen. Howard M. Metzenbaum (D-Ohio), the bill's most determined foe, agreed to permit a cloture vote Tuesday that could end his attempts to kill the bill by filibuster.

If Baker can muster the 60 votes needed to shut off debate, it could clear the way for passage of a bill approved by the Commerce Committee in a 14-to-0 vote and strongly supported by the maritime industry and maritime labor unions.

Several senators, however, said it is unlikely that Baker can get the 60 votes. In their view, the cloture vote is tantamount to a vote on the bill itself, because if cloture is not invoked, Metzenbaum and his handful of allies may be able to block a vote indefinitely.

Metzenbaum, who had been preventing the bill from coming to the floor, agreed to permit it to come up and to face the cloture vote in exchange for an understanding that several amendments recommended by the Judiciary Committee will be added. The Commerce Committee sought to cut Judiciary out of the action by rushing the bill to the floor before Judiciary could consider it.

Similar legislation was approved overwhelmingly in the House in the last Congress, but Metzenbaum killed it in the Senate by threatening a filibuster in the lame-duck session. This year, the House is expected to hold off on a new version of the bill until the outcome on the Senate side is known.

The Reagan administration has endorsed the bill as part of its overall program to revitalize the U.S. merchant fleet. Former Transportation secretary Drew Lewis was the administration's leading champion of maritime deregulation, however, and in his absence it is not clear how strongly the administration will push for enactment.

As reported out of the Commerce Committee, the bill would confer on the operators of American-registered, American-crewed liner vessels, and on their users, antitrust exemptions granted to few, if any, other industries. Liner vessels are common carriers that carry general cargo on specific routes according to fixed schedules. The legislation would not apply to bulk carriers, such as tankers or grain ships.

Ship operators said the measure is necessary to enable them to compete for cargo on international routes where the ships of other nations are free to set rates, pool revenues and agree on schedules. With American vessels carrying only about 27 percent of this nation's international liner tonnage, the operators and the maritime unions persuaded the administration that their industry faced extinction without the liberalizing legislation.

Opponents say the exemption is unnecessary and will lead to higher freight rates. Thomas J. Campbell, director of the Federal Trade Commission's bureau of competition, said at the Judiciary Committee's hearing that "further reduction or elimination of effective competition in liner shipping would be extremely unfortunate. The result would be to deny to U.S. exporters and importers, and ultimately U.S. consumers as well, the economic benefits of a competitive marketplace."