Changes in the lunch habits of federal workers, newly mobile because of Metro, and lured outside by more fast-food eateries near their offices and in some cases longer lunch periods, are hitting government cafeterias in the cash register.

In the face of declining patronage which has combined with inflation to cause "major financial difficulties," prices at 38 U.S. cafeterias went up 5 per cent yesterday. Further price rises and even the closing of certain cafeterias may follow if patronage does not pick up, according to officials.

At the FBI headquarters, for instance, the cafeteria went from a profit of $65,000 last year to a loss of $40,000 this year, according to Ted Leininger, of General Services Administration (GSA).

He attributed the drop primarily to two things: to the FBI's "slacking off on working by the bells," so that employes no longer are so strictly limited in their lunch periods; and to the crop of fast food establishments that have opened nearby.

Patronage at 38 government locations have dropped 27 percent in the past four years, according to M. T. (Barney) Allen, president of Government Services, Inc., a private contractor. The firm has been managing government cafeterias for 50 years.

The decline in customers varies from one cafeteria to another depending on how close it is to Metro stops, and competing lunchtime attractions such as other eating places and shopping facilities, and also on how strictly the agency enforces lunch time limits, officials said.

Cafeteria attendance also fluxuates along with the outdoor chill and gloom factor.

"Reasonable people naturally want to get out of their building for lunch, if they can." said Allen. "But short range, if people want to keep these cafeterias, they need to use them as more than just rainy day places."

"You've got to get out of your building every so often to get some air and keep your sanity," said one of a group of Housing and Urban Development workers heading into a nearby Metro station, with plans to try a Chinese place at Rosslyn. "But I'd hate to see our cafeteria close."

Most government agencies "authorize" a 30-minute lunch period, officials noted, but they acknowledged that the limit is not widely enforced.

In a "Dear Patron" letter, GSI appealed to its federal clientele last week to support their local cafeteria or face "more drastic action."

Diners in some of the federal cafeterias reacted in various ways. Some suspected it was "just another trick" to raise prices; others said they usually eat in the cafeterias anyway and wondered how the lines could get any longer.

Allen said his company lost more than $200,000 on the government cafeteria contract for 1977 and estimates that GSI's costs on the contract will increase by $2 million this year.

The price increase, plus cutbacks in food services at the Department of Energy, the U.S. Geological Survey and the Central Intelligence Agency, plus cut backs in labor are expected to hold the contractor's loss to $335,000 this year, according to GSA's Leininger. GSA is the agency that handles the federal food services contract with GSI.

Prices in government cafeterias traditionally have been low compared to commercial prices, according to Lieninger, "but they're getting pretty close."

Because of fixed costs and necessarily lower efficiency, smaller cafeterias have suffered more from inflation than the big ones, officials said. In the cafeterias' three-tiered price system, diners in the smaller cafeterias pay the most for their food.

Almost two years ago, the Government Accounting Office decided that for many federal workers the half-hour lunch period is unrealistic and recommended the government consider lenthening it, adding the appropriate amount of time at the end of the work day. At least one employes' union objected that but, officials said, the Civil Service Commission is looking into the matter.