For years they were an unstoppable combination on Capitol Hill, three powerful groups cruising along in the same political boat.

There were the maritime unions, pouring fabulous amounts of money into congressional campaigns; the shipbuilders, with their huge yards generating thousands of jobs; and the shipping companies, carrying American exports around the globe.

But President Reagan's effort to abolish maritime subsidies and a concurrent worldwide shipping depression have splintered this coalition into fragments, each struggling to survive in a shrinking industry. The political clout of some factions has tended to cancel out the influence of the others, producing a stalemate in Congress at a time when the maritime business is in its most desperate state.

"The industry can't get its own act together," said Albert May, director of the Council of American-Flag Ship Operators. "People are fighting with each other. It's true with the unions, it's true with the companies, it's true between the shipyards and the ship operators."

David G. Dye, a staff member on the Senate merchant marine subcommittee, blamed part of the legislative impasse on "a huge, ugly contest" between two rival unions, the Seafarers International Union and the Marine Engineers Beneficial Association.

"They both have the ability to kill any piece of legislation," Dye said. "One takes one position, one takes the other. Ergo, nothing ever gets done."

The maritime interests have been forced onto the defensive, struggling just to hang on to the subsidies they have enjoyed for decades. A dozen bills have been introduced to limit one subsidy alone -- the 31-year-old cargo preference program that reserves half of all government goods for American vessels.

In the face of such attacks, the industry is turning once again to its longtime friends in Congress. And when it comes to pure political strength, few can outmuscle the maritime unions.

During the 1983-84 election season, the Seafarers' political action committee poured $1.3 million into congressional campaigns, more than all but five other groups. What makes this remarkable is that the Seafarers have only 80,000 members.

By contrast, among the top five money-givers, the National Association of Realtors has 650,000 members; the American Medical Association, 260,000; the National Association of Home Builders, 135,000; the United Auto Workers, 1.4 million; and the National Education Association, 1.7 million.

The Seafarers, headed by Frank Drozak, made sure to contribute to 36 of the 40 members on the House Merchant Marine and Fisheries Committee, with half getting $5,000 or more.

Rep. Walter B. Jones (D-N.C.), the committee chairman, received $7,500. Rep. Mario Biaggi (D-N.Y.), chairman of the merchant marine subcommittee, got $8,500. Sen. Ted Stevens (R-Alaska), chairman of the Senate merchant marine subcommittee, got $5,000. And these lawmakers are regularly invited to address Seafarers meetings, usually for the maximum $2,000 speaking fee.

"We support, unashamedly and with no denials, those people who will help us," said Seafarers spokesman Charles Svenson. "It doesn't matter if they're Democrat or Republican or what their stand is on abortion. We don't expect rubber stamps or people who agree with us on everything; it's how open their door is to us."

Svenson brushed aside persistent reports that some union members are denied work unless they kick in to the Seafarers' PAC. He said all donations are voluntary and employes now have the money withheld from their paychecks.

"These guys are not averse to chipping in $100, $300, $500 a year," Svenson said. "They know it translates into jobs and job security; that's our pitch. There's no pressure put on a guy, other than the persuasive pressure that we apply."

The Marine Engineers Beneficial Association, with just 12,000 members, was No. 20 on the PAC list with $735,000 in contributions. But union president Jesse Calhoon called the donations "peanuts . . . . Basically, all I expect it to get me is a right to argue my point of view."

Other unions, from the Masters, Mates and Pilots International to the International Longshoremen's Association, also have considerable influence. And major shipbuilders such as General Dynamics have large and active PACs.

The prime recipients of this campaign cash are lawmakers on the merchant marine committees, who tend to be from coastal states with an interest in shipping or fishing. Former representative Paul N. (Pete) McCloskey (R-Calif.), who spent 16 years on the House Merchant Marine and Fisheries Committee, said its members were frequently swayed by the industry's largesse.

"No one wanted to be on the committee unless they were in the hands of the industry," McCloskey said. "It's the lapdog of the maritime industry."

Biaggi, who received $36,000 in maritime industry donations in the last two years -- more than 10 percent of his $306,000 in PAC money -- dismisses such charges. But he makes no bones about which side he is on.

"We're supposed to be working together with the industry," Biaggi said. "If we weren't, what the hell kind of outfit would we be? The contributions are made by every industry to every committee; it's the form of financing we have in this country."

Shipping is a rough and tumble business with a long history of passing illegal money to both customers and politicians, and Biaggi's subcommittee has not emerged unscathed. Three of its chairmen have been indicted in the last eight years.

Former representative Edward A. Garmatz (D-Md.) was charged in 1977 with conspiring to take $15,000 from shipping companies in exchange for favorable legislation; the case was later dropped. Former representative Frank Clark (D-Pa.), who had also been accused of being too close to the maritime unions, pled guilty in 1979 to payroll padding and income tax evasion; he was sentenced to two years in prison and fined $11,000. And former representative John M. Murphy (D-N.Y.) was convicted in 1980 in the Abscam investigation, which had no maritime connection; he received three years in prison and a $20,000 fine.

For all the industry's support in Congress, its internecine warfare has torpedoed every proposed solution.

The nation's ship operators, for example, are supporting an administration proposal to allow them to build their ships abroad -- where costs are two-thirds less than in U.S. shipyards -- and still receive federal operating subsidies. But the shipbuilders are lobbying just as hard against the measure, which they say would sound a death knell for their struggling business.

Albert May of the ship operators' group said defeating the plan will do nothing for U.S. shipbuilding. "The shipyards' strategy is to bring the operators down with them," he said. "They're clutching at straws. They're drowning men and they're desperate."

In similar fashion, Sea-Land, the only major unsubsidized U.S. carrier, is sharply critical of the operating subsidies that its competitors rely on. Sea-Land Chairman Joseph F. Abely Jr. called the system "just plain unfair" and accused the Maritime Administration of giving certain companies "a blank check." But other shippers say Sea-Land would grab the same subsidies if it could continue to build its ships abroad.

Perhaps no subsidy program stirs more emotions than cargo preference, a nice-sounding name for a quota system that forces American traders to ship some of their overseas goods on expensive U.S. vessels manned by American crews.

Half the weapons sold abroad by the Pentagon must be shipped on U.S. vessels. Half the oil for the Strategic Petroleum Reserve must be carried on U.S. ships. Half the American grain sold to Israel must move on U.S. ships. Even a private company, Chrysler Corp., was temporarily forced under the cargo-preference umbrella in exchange for its federal bailout.

These quotas apply to more than 15 federal agencies, from the Tennessee Valley Authority to the U.S. Information Agency. This means they must make up the difference between foreign shipping costs and the U.S. rates, which are two to six times higher.

The importance of the 1954 Cargo Preference Act is obvious: The shipments now compose nearly 40 percent of the freight carried on U.S. vessels. In the real world of competition, these ships carry less than 6 percent of foreign cargo. U.S. companies have registered more than 350 ships in Liberia and Panama so they can use cheaper foreign crews.

Without cargo preference, said Rep. Roy Dyson (D-Md.), "We wouldn't have anything. As sad as it is and as much as I hate to say it, we would have nobody traveling on American-flag ships."

Supporters say other countries reserve far more of their cargo for their own ships. But critics blame the vast U.S. disadvantage on larger union crews who work fewer hours for much higher pay and benefits than their foreign counterparts.

Over the years, McCloskey said, "The unions built up immense power. You couldn't afford to pay the union wages or stand the union featherbedding. The United States used five unions to build a ship, with four guys standing around while the fifth tightened a bolt."

Union leaders say those practices are history. To win several recent Navy contracts, Svenson said, the Seafarers "have cut back on our crew size. We've cut back on our crew wages."

The debate is hardly new. President Lyndon B. Johnson was the first to propose giving operating subsidies to U.S. companies for ships built abroad. President Richard M. Nixon pushed through a $3 billion, 300-ship construction program in 1970. But soaring costs torpedoed the plan, and only about 60 ships were built.

With each setback, maritime interests turned again to cargo preference. They pushed a bill through Congress in 1974 to reserve 30 percent of all oil imports for U.S.-flag ships, only to watch President Gerald R. Ford veto it. The industry responded by pouring $150,000 into Jimmy Carter's presidential campaign.

In 1977, when President Carter endorsed a bill to reserve 10 percent of oil imports for U.S. ships, the Republicans accused him of "a blatant political payoff." The House, stung by charges that it was also awash in maritime money, voted down the bill.

More recently, Rep. Corinne C. (Lindy) Boggs (D-La.) and Sen. Paul S. Trible Jr. (R-Va.) sponsored a bill last year that would gradually reserve 20 percent of oil imports for U.S. ships in exchange for an effort to lower costs. Boggs says she is revising the bill to improve its chances of passage.

Those chances are dim because the nation's biggest exporters -- in agriculture, oil and timber -- detest cargo preference. Farmers are leading the counterattack this year, and the Agriculture Department recently suspended a $500 million export program rather than comply with cargo preference.

Maritime supporters such as Biaggi respond that cargo preference is "minuscule" and that farm leaders are trying to divert attention from their own economic problems and much larger federal subsidies.

At a time of world hunger, however, cargo preference programs such as Food for Peace are a highly visible target. John Baize, director of the American Soybean Association, said the $150 million a year the program spends on shipping subsidies could be used to deliver 811,000 metric tons of wheat to starving Africans.

"It's an absolutely ludicrous degree of subsidy to the merchant marine," Baize said. "Nobody ever uses U.S.-flag vessels unless they have to. You're not going to voluntarily pay a U.S. company 200 percent more than you have to pay a Liberian vessel or a Greek vessel or a Panamanian vessel.