THE GRAVY TRAIN pulled out of the station in the dead of night Wednesday, with no one on board but congressmen. Congress had succumbed to the temptation to use the veto-proof emergency funding bill to raise its own pay and perks.

It looked like the last gravy train for some time and, like the last helicopter out of Saigon, it unfortunately had to leave a lot of people behind. Once again, Congress has stranded the top ranks of the civil service. Congress insists on keeping the federal employees' pay scale below its own salaries, creating a cap on federal pay. As inflation lifts the federal pay scale, more and more senior administrators are bumping against the congressional cap.

For them, the cap has abolished all pay incentives. Worse, it has created a powerful incentive to stop working altogether and take early retirement. Retirement pay rises with inflation and, unlike the salaries of people stil on the job, it is not subject to any cap. Federal employees who retire early from the upper ranks can soon find themselves drawing larger incomes than they would have been able to earn if they had continued to work.

The one positive and sensible innovation in this midnight legislation was to link congressional pay, in the future, to the federal employees' scale. As the civil service salaries go up, congressional salaries will also go up -- automatically. But it won't begin until 1983, so all the present anomalies will continue until then.

The midnight bil also abolished the previous limit of $25,000 a year on a senator's outside earnings. A senator's outside earnings are, typically, fees for speeches. If a senator's subcommittee is about to hold hearings on the health hazards posed by rocking horses, he may well be invited to address, for a fee, the Rocking Horse Manufacturers Association. Outside earnings of this dubious sort are tolerable within limits. But now the Senate has removed the limits.

The justification for these outside earnings, incidentally, used to be the great expense of having to maintain two homes, one in the constituency and one here in Washington. But while this bill takes the restriction off the outside earnings, it simultaneously reduces the burden of the dual homes by making them tax-deductible.

Congressmen have difficult jobs with uncertain tenure. They are entitled to be paid well. But it might be noted that their present salaries, at $60,662.50 a year, are within the top 5 percent of American incomes. It might also be noted that the gravy train roared through Congress just as the new fiscal year began, with its reductions in food stamps, student loans and health care for the poor.