An airline pilot needs a license, a bus driver needs a license, a truck driver needs a license, even average-citizen motorists need a license. But strange as it may seem, a railroad engineer can drive a locomotive without any license.

That glaring lack is in the process of being corrected in Congress where the House this week passed a bill setting up the first national standards on who can operate a train. The measure also gives the government tougher rules in dealing with railroad accidents. The legislation now goes to the Senate, where passage also is expected. But the measure contains a loophole that ought to be plugged.The fact that railroad engineers don't have the equivalents of a trucker's license doesn't mean they are unskilled. A person becomes an operating engineer only after years of training. But requiring a license would give authorities a chance to weed out improper applicants.

For example, those seeking to become engineers would have their auto driving records examined for drug and alcohol convictions. Such black marks would require completion of a rehabilitation program before any license would be granted.

The bill also would make it illegal to disable safety devices on railroads, a practice not now illegal; would require within three years the installation of "black boxes" like those on aircraft to record a train's instruments; would require automatic brakes on freight trains in the busy Northeast Corridor; would raise fines for safety violations; and would penalize individual workers as well as railroad companies for such violations.

In the light of serious rail accidents in recent years, the bill looks like a proper move. The only thing missing is a random drug testing program for railroad workers. Drugs have been mentioned as a problem in several of the more serious railroad crashes. Even though railroad unions are against such testing, that loophole should be closed.