Budget negotiations between Congress and the Reagan administration suffered an unexpected and apparently serious setback yesterday as Democrats accused White House negotiators of imposing new demands just as the talks were close to producing an accord on reducing the federal deficit.

The sudden problems may mean that an agreement is not possible until next week at the earliest, when the high-level talks prompted by the stock market collapse will enter their fourth week.

The reversal revived discussions of proposals to trim inflation adjustments for federal workers and retirees, including Social Security beneficiaries, to help achieve the goal of cutting the deficit by about $30 billion this year. A new proposal was floated in the talks late in the day that would save $2 billion by delaying for three months all federal cost-of-living adjustments scheduled to take effect in January.

If Congress and the White House fail to reach agreement on reducing the projected fiscal 1988 federal deficit by at least $23 billion by next Friday, the revised balanced-budget law requires across-the-board spending cuts in most domestic and defense programs -- with important exceptions such as Social Security.

"I think everybody in the room last {Wednesday} night left thinking we were very close," said Rep. William H. Gray III (D-Pa.), the chairman of the House Budget Committee. "I said in the room," Gray repeated for emphasis, a reference to the widespread belief among Democrats that administration negotiators had changed their bargaining stance after a meeting with the president.

Aides to a number of Democratic lawmakers were even harsher in their assessments. They accused White House negotiators of "pulling the rug out at the last minute" by abruptly demanding fewer cuts in defense, smaller tax increases and deeper domestic spending cuts than they had previously indicated were acceptable.

One Democratic lawmaker who asked not to be identified said that when the administration team relayed "the White House objections, the meeting almost collapsed."

White House chief of staff Howard H. Baker, Jr. angrily denied the charges. "Anybody who tries to characterize it as the White House pulling the plug is completely, totally wrong," he said. "The president's position has been consistent throughout . . . . Anybody who says the president's changed his position . . . must have some other motive."

Republican lawmakers in the talks agreed, saying that the discussions had faltered temporarily because anticipated savings in entitlement programs, such as Medicare, and in military spending had proven overly optimistic and because of stiffening resistance among members of both parties to the emerging agreement.

"There were plenty of disagreements, not just from the White House," said Sen. Pete V. Domenici (R-N.M.). "We're just unable at this point to reach an agreement."

Democrats disagreed. "They're just covering up for the president," said one Democratic aide.

Both sides had appeared to be nearing agreement on a package of revenues and spending cuts that would have resulted in cutting the federal deficit by about $30 billion, in part through a tax increase of about $10 billion.

Yesterday, the White House negotiating team sought to get a grip on what specific taxes would be included.

"They're going to have to know more to convince the president," to support higher taxes, said Rep. Robert H. Michel (R-Ill.), the House GOP leader. The package that had been emerging on Wednesday, said Michel, contained "too much revenue for what you get in real spending cuts" and would have encountered significant Republican opposition on the House floor.

But Democrats, reflecting the delicate balancing act required in putting together a package that would pass both houses, predicted that any softening of their positions on taxes and defense spending could cost them up to 100 liberal votes on the House floor and jeopardize the outcome.

The sudden snag in the talks that had finally brought the White House and Congress to the negotiating table after ten months of bickering over the budget, also sparked new interest in cutting federal cost-of-living adjustments, a politically sensitive subject that has made negotiators skittish for almost two weeks.

Sen. Bob Packwood (R-Ore.), urging support for the idea, said "it's easier and more symbolic" to find the extra $2 billion in spending cuts necessary to produce an agreement by reducing inflation allowances to federal workers and retirees.

Other members of Congress, including House Majority Leader Thomas S. Foley (D-Wash.), insisted that delaying cost-of-living allowances was "not on the table."

Foley and Domenici both tried to put the best face possible on yesterday's developments.

"These talks have not failed and I don't think they will fail," said Foley.

Meanwhile, the Office of Management and Budget has ordered agencies to cut spending to achieve the $23 billion deficit reduction the balanced budget law will require if no agreement is reached by Nov. 20.

"This is the most common sense approach," said OMB spokesman Barbara Clay. The departments "need to be prepared whatever might happen. It is easier to raise the level of spending later if the order doesn't go into effect than it would be to reduce spending further if it does."

Staff writer Judy Havemann contributed to this report.