House Democrats, rebounding after two years of budget losses to President Reagan, yesterday won a preliminary test vote, 230 to 187, on an $863.5 billion budget that would raise taxes, reduce the Pentagon's big spending increase and restore money that has been cut from scores of social welfare programs.

Although the vote was only procedural, House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) predicted that the Democrats will prevail when the budget comes to a vote today. Minority Leader Robert H. Michel (R-Ill.) conceded that the "odds don't look all that good."

"We think we have 15 to 20 to spare," O'Neill said. "Unless we have some hidden votes against us . . . , we seem to be in pretty good shape."

But Reagan stepped up his lobbying campaign against the Democratic budget with meetings at the White House, telephone calls to wavering lawmakers and an announcement that he will make a nationally televised speech on defense tonight.

"This budget that has been proposed by the Democrats must be defeated," Reagan told a group of House Republicans.

"This is going back to the type of government program that caused the problems that we're facing today," he added.

In tonight's television speech seeking support for his defense buildup, Reagan intends to display some aerial photographs detailing the Soviet military buildup, administration officials said.

Administration sources said that Reagan intends to display for the first time photographs that detail the Soviet military expansion, although there was some resistance to revealing the most sophisticated data from satellites.

Some of the photographs have been used in classified briefings for members of Congress in recent weeks as the administration has sought to make the case for the Reagan rearmament.

White House spokesman Larry Speakes said yesterday that Reagan will "underscore the administration's commitment to restoring the United States' defense posture . . . ." He added that the "major objective" of the speech "is to acquaint the American people with the threat" posed by the "relentless" Soviet military buildup.

In yesterday's vote, which set the rules for today's voting, the Democrats lost about 20 conservatives and a half-dozen blacks, who were blocked by the rules from introducing their amendments today. But Democratic leaders held enough of their own troops to defeat a united Republican minority with plenty of votes to spare.

The Democrats conceded, however, that they could suffer more losses today. And Michel said, "It's damn close . . . . We still have a shot at it."

Despite the procedural nature of yesterday's vote, the debate was largely on the budget itself, with the Republicans--in a reverse twist of the steamroller charges that Democrats leveled against Reagan in 1981 and 1982--accusing the Democrats of trying to ram the budget through a reluctant House.

"This is King Caucus at its best," complained Minority Whip Trent Lott (R-Miss.) in reference to the Democratic caucus' involvement in drafting the budget. The draft was candidly labeled "A Democratic Plan for Economic Recovery" in the document approved last week by the House Budget Committee.

Speaking of the House Rules Committee decision that foreclosed all amendments except a Republican substitute that GOP leaders were reluctant to offer, Lott said, "The steamroller was rolling, baby, and there was no stopping . . . . "

"How quick they forget," said O'Neill. "That's what they were doing last year: running me over with a steamroller. They just left me lying there . . . . "

Republicans also were scathing in their criticism of the contents of the budget, which would cut Reagan's 10 percent increase in defense spending after inflation to 4 percent, restore $33 billion in domestic spending and increase taxes by $30 billion, enough to allow for repeal of the 10 percent income tax cut scheduled for July 1.

"This budget reverts to big spending as usual for all the goody-goody-type social programs . . . . Yes, the deficit would be reduced, but at the cost of increased taxes and lower defense spending," said Rep. Delbert L. Latta (R-Ohio), ranking Republican on the Budget Committee.

Democrats responded with a tweak for Reagan. "He who preaches so piously about deficits has produced the highest deficits in American history," three times as high as the deficits of any of his predecessors, said Majority Leader James C. Wright Jr. (D-Tex.).

Reagan's budget includes a deficit of $188.8 billion for fiscal 1984. The Democrats' budget includes a $174.5 billion deficit.

As of late yesterday, Republicans indicated that they were leaning against offering a substitute to the Democratic budget, although Michel said he was considering an amendment, possibly on taxes.

Some Republicans complained bitterly that the procedures under which the Democrats were operating required a Congressional Budget Office analysis of any substitute they might offer, meaning that they would be hard-pressed for time to offer anything but Reagan's budget.

They would not offer Reagan's budget, said one GOP said, "because it won't pass, pure and simple."

But some of the harshest criticism of the Democratic leadership tactics came from black Democrats, who had wanted to offer an alternative budget but were precluded by the rules from doing so.

"I consider that an insult to the black people, the working people and those who have looked for inspiration to the Congressional Black Caucus budget," said Rep. John Conyers Jr. (D-Mich.).

The key question today is how many conservative southern Democrats, who held the key to Reagan's budget victories over the past two years, will vote with the president.

Yesterday's vote, and comments of conservative leaders, indicated they were sharply split. One such leader predicted that only about 30 Democrats would defect in the final vote on the budget, well short of the nearly 50 Democratic votes Reagan would need to win.

Rather than helping, he said, Reagan's heated rhetoric about the Democratic budget had hurt his cause among Democratic conservatives in Congress.

"It may have helped him in the country, but it didn't help him here," the conservative said.

In his renewed criticism of the Democratic budget yesterday, Reagan said the Democrats would raise taxes by $315 billion over five years, cancel most of the earlier savings in big benefit programs, increase domestic spending by $181 billion through 1988 and reduce defense spending increases to a level below what former President Carter had proposed three years ago.

In yesterday's vote, Republicans cast 157 votes against the rules and no votes for them; 230 Democrats voted for, and 30 against, the rules. Washington-area members from Virginia voted against the rules; all Marylanders voted for the rules except Rep. Marjorie S. Holt (R).