The Democratic House gave party-line approval yesterday to its own balanced-budget plan, intensifying an impasse with the Republican-led Senate that triggered a Treasury Department move to tap Social Security trust funds to keep the government operating.

Shortly after midnight the Senate approved a short-term extension of the debt ceiling to allow the government to continue borrowing through next Wednesday without dipping into the Social Security fund. However, it was worded differently from a five-day extension passed earlier by the House. In any case, the Treasury Department said the funds were tapped as of midnight last night.

The 249-to-180 vote in the House for the Democratic alternative to a budget plan approved earlier by the Senate came only hours before the administration deadline for extension of the debt ceiling. The balanced-budget legislation is part of a bill to extend the debt ceiling for a year, and differences between the two houses on budget provisions must be resolved before the debt measure can be passed.

The House action bucked the problem back to the Senate, which passed its budget plan last month by a bipartisan vote of 75 to 24.

The House then passed a brief debt-ceiling extension to tide the government over for five days and quit for the weekend, leaving the Senate in a bind. The Senate's options included approving the House-passed bill, passing a short-term debt-ceiling extension it didn't want or acquiescing in the controversial use of Social Security trust funds to avert a debt crisis.

Senate Republican leaders reluctantly agreed to consider the short-term extension but found fault with the House version, contending it had loopholes that would extend borrowing authority into next year, thus diminishing leverage to force passage of the balanced-budget requirements. The Senate passed its own short-term extension by 51 to 22.

But, without agreement by both houses on a five-day extension, the Treasury Department is believed to have authority to use the Social Security and other trust funds to continue borrowing for another two weeks.

The Senate is expected to begin debate on a modified version of its own modified budget plan early next week. Then, if the House doesn't accept the Senate plan, the issue is likely to go back to conference. A previous conference on the issue broke up Thursday night in deadlock.

The Senate and House plans both set annual deficit-reduction targets to achieve a balanced budget over the next four to five years, forcing automatic spending cuts, if necessary, to achieve the goals. But the Democratic plan would speed up the process, cut more from defense, protect some low-income programs, eliminate presidential discretion in apportioning the cuts and provide for a court test that could scuttle the plan.

The government had run out of cash and needed a debt-limit extension to borrow funds to continue normal operations, including payment of Social Security benefits over the weekend. But the bill lifting the limit from $1.8 trillion to $2 trillion was amended by the Senate to include the balanced-budget legislation and cannot be passed without a compromise.

In the absence of a compromise, the administration had said it would start early today to cancel government securities held by the Social Security and other retirement trust funds in order to allow more borrowing within the current ceiling.

The short-term extension of the ceiling, which the House approved by a vote of 357 to 61, would protect the trust funds while a budget compromise is worked on next week. The interim extension would raise the ceiling by $17 billion, which officials said was enough to last through Wednesday.

Earlier, Senate Majority Leader Robert J. Dole (R-Kan.), apparently facing threats of a filibuster by senators determined to force passage of the Senate's version of the budget measure, said the House would be wasting its time in passing a stopgap extension. The Senate, he indicated, would not pass it.

House passage of the Democratic plan was a major tactical victory for Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) and other Democratic leaders, who four years ago were unable to hold their party together in budget fights with President Reagan.

"We learned our lesson in 1981 . . . . We have recaptured the deficit issue," said Rep. Leon E. Panetta (D-Calif.), a principal drafter of the House plan.

But the House Democrats acted only in response to the Senate Republican initiative, and many Democrats showed little enthusiasm. Rep. Jack Brooks (D-Tex.) called it "damage control." Rep. Richard A. Gephardt (D-Mo.) called it a "second best policy." O'Neill said, "We've cleaned up the inequities and mistakes and the errors of the Senate legislation."

The vote was about as close to a party-line division as possible, with only two Democrats and one Republican defecting from their parties' positions. The dissenters were Reps. John Paul Hammerschmidt (R-Ark.), George W. Crockett Jr. (D-Mich.) and Paul E. Kanjorski (D-Pa.).

Democratic unity appeared to be enhanced by frustration over Senate hardball tactics in insisting on its own plan. Rep. David R. Obey (D-Wis.) referred to "blackmail by the Senate," and O'Neill had some caustic words for Dole, saying, "If Dole thinks he's going to logroll this the Senate plan , then he's got another think coming."

But the House then resorted to hardball tactics by adjourning for the weekend while the Senate was debating the budget measure.

There was no head-to-head choice in the House between the competing versions of the balanced-budget legislation because approval of the Democratic plan precluded action on the Republican draft. But the differences had been spelled out in detail and rhetorical flourish, with Republicans calling the Democratic plan "fraud" and Democrats calling the Republican plan "a torpedo aimed at the ship of state."

The Democratic plan would set a deficit target of $161 billion for this year, declining to zero by fiscal 1990, compared with a Republican target of $172 billion, dropping to zero by fiscal 1991.

The Senate's original version set this year's target at $180 billion, which Democrats derided as a "Republican incumbents' protection act" because it required few if any spending cuts before next year's elections.

The Democratic plan exempted such welfare programs as food stamps and Aid to Families with Dependent Children from automatic cutback provisions, although some other low-income programs, such as Medicaid, were included at the last minute to pick up conservative support. The Republicans exempted no programs except Social Security.

To minimize presidential discretion in determining what programs to cut, the Democrats gave the Congressional Budget Office the primary role in allocating cuts, relegating the president's Office of Management and Budget to a consultative role. In the Republican version, the two agencies shared the powers, with the General Accounting Office acting as arbiter.

The Democrats also sought to bar the president from cutting domestic programs if he refuses to cut defense and from vetoing congressional deficit-reduction plans to force implementation of the automatic cutbacks. Defense would take a greater share of the cutbacks under the Democratic formula.

Unlike the Republicans, the Democrats proposed an automatic court test of the legislation, specifying that the whole plan would die if any part of it is knocked out by the courts. This, coupled with provisions of contested legality such as restrictions on presidential veto powers, led Republicans to complain that the plan was "calculated to self-destruct."