How is it possible that so many federal workers in Washington -- whose average salary is $31,000 -- think they are underpaid, while most American workers think that civil servants are overpaid?

Are these two groups -- sometimes neighbors -- living on the same planet?

The answer is yes, and no, according to a fascinating article in the May issue of the Washington Monthly magazine. The name of the story, "How to End the Federal Pension Scandal," won't endear it to most federal workers, nor will some of the solutions it offers.

But the article makes some interesting points that both sides should consider.

For instance, it says that federal employe morale was sky-high under President Kennedy and has hit bottom under President Reagan. "One result," said writer Timothy Noah, "is self pity and a greater concern about salaries and pensions."

Noah points out that Washington is a very rich city and the nonfederal "working class" here is a lot different from the working class in Youngstown, Ohio, or Hagerstown, Md., or most any other American city. That, he says, is because of the "explosion of trade associations, consulting businesses and law firms" in the past 20 years that pay salaries that make federal wages "seem modest."

"Twenty years ago a middle-level federal bureaucrat could afford to go to all but a handful of restaurants in Washington without too much worry," he writes.

"Today, however, the city is overrun with restaurants like Le Pavilion and The Palm, where the customers are almost never federal workers.

"The proliferation of conspicuously high-paid professionals has created a deep sense of envy in the federal bureaucracy, not to mention a distorted view of what the private sector is like. Washingon has almost no industry, and hence few blue-collar employes, to round out the Washington bureaucrats' picture of the American work force."

You may not like the article but it is food for thought, whether you lunch at The Palm or in the cafeteria.