WHEN A LARGE American bank gets into trouble, the law restricts its search for help. The case of the Marine Midland Bank illustrates the point. The Marine Midland case seems to be working out satisfactorily, but the solution is not necessarily one that people would want to see repeated frequently. For it is possible to approve the outcome in this case, as the federal banking regulators have done, and yet have misgivings about the present banking laws and the direction in which they are taking the banking system.

The Marine Midland Bank got into trouble in the turbulence that followed the last recession, emerging stable but weakened and in need of capital. The obvious way to get it was through merger with another bank. But here the banking laws created a peculiar situation. The antitrust rules forbid -- necessarily -- the merger of banks competing in the same markets. But other federal statutes effectively prevent a bank from operating across state lines. Since Marine Midland is based in Buffalo, N.Y., that might have indicated a merger with another bank in New York State. But Marine Midland is a very big operation -- the 12th largest bank in the United States -- and as a practical matter it would have been impossible to find any merger within the state that met the antitrust test. That left only one possibility -- to sell Marine Midland to a foreign bank.

That's how it is working out. Two years ago the Hongkong and Shanghai Banking Corp. of Hong Kong offered to buy a controlling interest in Marine Midland. But Marine Midland was operating under a state charter, and the state banking authorities immediately raised all the issues of foreign ownership. They resisted the sale on grounds, among others, that it would be difficlut for the state to maintain effective supervision over the parent bank in Hong Kong.

The federal regulators took a different view. For one thing, foreign banks have been operating in the United States for many years -- Hongkong and Shanghai itself opened a San Francisco office in 1875 -- and there have been no unusual difficulties. For another thing, American banks have expanded aggressively all over the world and the principle of reciprocity applies.

Eventually, Marine Midland decided to step out of the state's jurisdiction and applied to the U.S. Comptroller of the Currency, John G. Heimann, for a national charter. Last week Mr. Heimann approved the charter and, in effect, the sale.

There is not much reason, at present, to worry about the passage of influence over the American monetary system into foreign hands. Even after the Marine Midland sale, the banks owned by foreign interests will represent less than 5 percent of the commercial banking system's total assets. But, at least theoretically, there is a point at which a steady rise in that proportion might warrant a sharper concern. Perhaps the time has come to reconsider those laws preventing banks from crossing state lines. It's necessary to question the wisdom of legislation that unintentionally requires a large bank, in need of help, to look abroad for it.