IF THE RAILROADS are not the most overregulated business in the country, they are close to it. For almost a century, the Interstate Commerce Commission has been relentless in its oversight. The result has been disastrous -- even now, bankruptcies are common, and over the past five years the federal government has poured more than $11 billion into keeping the railroads running.

You would therefore think that, in this day deregulation-chic, relaxing some government controls on the railroads would be easy. Not so. Passage by the Senate of even the mild deregulation measure scheduled to come before it soon is uncertain.

The bill, approved by the Commerce Committee 14 to 0 last December, is only a shadow of what the Carter administration originally sought. In the most critical area -- freight rates -- it would permit the railroads to raise rates 4 percent a year, up to a maximum of 12 percent over five years, without having to defend their actions before the ICC. The administration had sought a "free zone" of 12 percent a year.

But even this limited grant of freedom to the railroads is in trouble. Sen. Russell D. Long, worried about the impact on the price of electricity of increases in the rates charged for hauling coal, has proposed an amendment that would gut the whole deregulation effort. Sen. Long wants to put a cap on freight rates and has proposed a complicated triggering mechanism that would give the ICC control over many proposed new freight rates. Not only would the mechanism accomplish what Sen. Long seeks; it would also get the ICC more deeply into the rate-setting business than it has been for decades.

To counter this effort, the administration and Commerce Committee Chairman Howard W. Cannon have compromised on their already weak bill. Sen. Cannon's alternative is to accept enough of Sen. Long's proposal to provide some ICC protection for "captive" shippers -- those who must rely on railroads for their freight -- while freezing railroads to raise other rates by 6 percent a year.

While this compromise is not even as good as the committee bill, it is at least a step toward orderly deregulation. It may well mean that the price of electricity will go up in parts of the country were it is generated from coal hauled over long distances, while the prices of other products will go up everywhere. But the inflationary impact of beginning to let the railroad industry set its own rates will be far less severe than would be the impact of holding those rates down arbitrarily and forcing the federal government to bail out one bankrupt company after another. Deregulation does have its costs. But the record of the past 20 years shows that the costs of tight government control of this industry are even higher.