THE PEOPLE WHO RUN service stations won a substantial victory when the Supreme Court upheld the Maryland gasoline retailing law. For the oil companies, it was a defeat. The immediate cost to consumers will be, we think, a good deal less than the oil companies claim. For the longer future, however, an important source of competition in the oil industry will be threatened. The protection to the small retailers is likely to be less effective than they expect. But, whatever its defects, this legislation is a penalty that the oil companies have brought upon themselves.

When you pull into a service station with one of the major brand names - Texaco, Exxon, and so forth - it is probably an independent business whose operator leases it from the oil company. The operator puts in some capital of his own, hires his won help, keeps his own books and buys his gasoline at whoesale prices from the company whose brand he sells. The company leaves it up to him to make a profit. There are incesssant quarrels between companies and dealers over hours, prices and margins.Currently one major complaint among dealers is rent. Companies are raising rent, squeezing the profits of the dealers who can't pass it on because of gasoline price controls.

Other kinds of small-business men can drop a troublesome supplier and shift to another. the service-station operator can't do that because his supplier is also his landlord. But the landlord can always get rid of the dealer by refusing to renew his lease. To maintain tight control the oil companies keep leases short, usually no more than one year.

The service-station operators' insecurity has been aggravated in recent years by a widespread fear that the major oil companies intend to take over the most profitable service stations and run them directly with their own salaried employes. Some of the companies already run stations of their own - usually very big stations, like those on the interstate highways. The operators who lease their stations believe that they will increasingly find themselves competing with the refining companies that supply them. Dealers say that companies, to meet local competition, sometimes cut retail prices at their own outlets below even the wholesale prices at which they sell gasoline to their leased service stations.

In 1974 Maryland passed its Dealers' Day in Court law, giving the dealers a measure of protection against arbitrary cancellation of leases. Congress has just passed a similar law, which is now awaiting President Carter's signature. Then the Maryland legislature enacted a second bill, prohibiting the oil-refining companies to sell gasoline at a uniform wholesale price throughout the state. That is the legislation the Supreme Court has now upheld. The Companies fear that, like its predecessor, it will be taken by Congress as a model for federal law.

The Maryland legislation restricts price competition, as the Court observed. While it may not be unconstitutional, that kind of regulation is bad in principle. But the accumulated grievances of the dealers have become an invitation to political redress. Whether legislatures can give any real security to the corner filling station is another question. It's possible that service stations may face the same fate as the corner grocery store did a generation ago when the chain supermarkets moved in. The greater threat to the service station operators may eventually turn out to be not the major companies, but the high-volume chain outlets of the future.