A study recommending a federal railyard for Delaware instead of Massachusetts was consigned to oblivion after the intervention of Speaker Thomas P. O'Neill Jr., making clear that politics in Jimmy Carter's Washington is played much as it has been for nearly two centuries.

O'Neill is not only the most powerful member of Congress but a loyal son of Massachusetts intent on federal favors for his state and its sons. The Carter White House is increasingly attentive to O'Neill and other Democratic members of Congress, particularly those with difficult fights for reelection.

Since this is the way business always has been conducted in this town, politics as usual under President Carter is remarkable only in view of his campaign's vows of righteousness. In ways less convulsive than supporting Bert Lance, the President all summer has been quietly shedding layers of campaign sanctimony.

Tip O'Neill has been a major catalyst in the change. Presidential aide Hamilton Jordan's cavalier treatment of the Speaker in handing out inaugural tickets is a distant memory. Most notably, O'Neill has won presidential selection of a political crony from Boston to the Federal Election Commission over obviously better qualified candidates and kept Fort Devens operating despite expert recommendations that the old Massachusetts Army base be closed to cut costs.

O'Neill's latest intervention concerns a new heavy-maintenance facility for Amtrak in the Northeast corridor. A study prepared by the Federal Railroad Administration (FRA) for Secretary of transportation Brock Adams recommended Wilmington, Del., over competing sites in Washington and Boston.

But O'Neill considered Boston infinitely preferable. "The Speaker made it very, very clear," one federal railway official told us, "that the one thing he wanted was the Amtrak facility located in Boston." Secretary Adams informed the FRA that he was "dissatisfied" with the report, and was widely expected to select the Boston side by Aug. 1.

That has been delayed by persistent efforts of Delaware's three-member congressional delegation. During the week of Aug. 1, Republican Sen. William Roth repeatedly telephoned Adams, but his calls were not returned by the usually congenial Secretary of Transportation. When Roth charged an "arrogant and persistent political coverup," Adams denied political motivation and said no decision had been made.

Nevertheless, that FRA study that recommended Wilmington has been kept from members of Congress and is significantly harder to obtain than a top secret national-security document. Moreover, there is little doubt - even among people in Delaware - that ultimately O'Neill will not be disappointed by the location of the Amtrak rail yards.

The Speaker meets less resistance in influencing federal appointments. Nobody but O'Neill's inner circle knows how many officials he has placed in the government this year, but the length of the Speaker's arm is measured by one obscure appointment: general counsel of the Commodity Futures Trading Commission.

The White House preference had been designated when the Speaker's office telephoned Chairman William Bagley with a late-entry: John G. Gaine, 34, who worked summers between 1959 and 1965 as a legislative intern for Rep. Edward Boland of Massachusetts, O'Neill closest pal. Bagley informed the White House of the new development and was given this reply: We have no objection to anybody the Speaker wants. Gaine started work July 31.

Politics as usual is by no means O'Neills exclusive property. During a group meeting of congressmen with the President this summer, Republican Rep. William Cohen of Maine asked whether his state's delegation might have the same chance to convince the Pentagon that Loring Air Force Base should be kept open that O'Neill's Massachusetts delegation had with Fort Devens. The President cordially agreed, telling Cohen to call to set up the meeting.

That was less than pleasant news for Democratic Sen. William Hathaway who might have to run for reelection against Cohen next year. Hathaway telephoned the White House, which quickly took corrective action. The senator was authorized to say the White House had asked him, not Cohen, to arrange a meeting. When Cohen called the White House to set up the meeting promised him by the President, he experienced the same fate as Roth and other Republicans: Unanswered phone calls, one after another.

There is nothing new or improper in a Democratic congressmen for federal goodies. It is, however, foreign to the tone of the President's rigidly high-minded campaign, but that may soon be of interest only to purists and, perhaps, a few naive voters.