In a dramatic though symbolic demonstration of a new mood of toughness, the Senate yesterday voted 55 to 42 to permit annual increases of 5 percent after inflation in the 1981 and 1982 defense budgets.

This would amount to $25 billion more than the Senate Budget Committee had recommended for defense, budget in 1982, much more than President Carter has asked for.

The Senate's vote was the best evidence yet of the changing temper of the Senate since hearings began in July on the new strategic arms limitation treaty. Yesterday's vote suggested the existence of a new, but not necessarily permanent, consensus in the Senate supporting substantially expanded American defense efforts in response to the Soviet buildup of recent years.

The Carter administration had supported a 3 percent annual increase in defense spending, but the senators who backed the 5 percent alternative decisively carried the Senate yesterday, winning key moderate votes in both the Democratic and Republican columns.

The Senate earlier approved, 78 to 19, an administration-supported proposal to add 3 percent, or $3.2 billion, to the fiscal 1980 defense budget.

Whether congressional majorities will exist next year or the year after for spending proposals that would add $25 billion or more to the defense budget remains to be seen. Many senators acknowledged yesterday that it was much easier to vote for a nonbinding change in the budget resolution, which is what they did, than actually to appropriate those huge sums.

Moreover, until now there has been no sign that the House of Representatives shares the new mood that has emerged in the Senate. The House may not go along with any big increases in the Pentagon's budget.

The defense spending Issue has become part of the debate over SALT II, with a number of senators declaring that they will support the treaty only if it is accompanied by a larger Pentagon budget. Probably the most important backer in the category is Sam Nunn (D-Ga.), one of the backers of the 5 percent increase.

After the vote, Nunn said the Senate's position on the budget resolution would not have "strong implications for SALT," because this vote alone could not alter the country's defense posture. He repeated his desire to see a new commitment from the Carter administration to a stronger defense, one manifested in next year's defense budget and in stronger leadership from President Carter.

But several Senate sources speculated yesterday that the vote could improve SALT's chances for approval, because it might give Nunn and like-minded senators a reason to think their concerns about the country's military posture were becoming widely shared. This interpretation was admittedly problematical, and many SALT supporters in the Senate remain deeply discouraged about the treaty's prospects.

Sources sympathetic to SALT said last night the Senate vote gave the administration an opportunity to alter its own line on defense spending in a way that might win over Nunn without allenating more dovish senators who oppose vast increases in the defense budget. Secretary of Defense Harold Brown will have a chance to signal any change in the administration's line when he testifies again today on SALT.

An important factor influencing both the gloom of SALT supporters in the Senate and yesterday's vote on defense spending is the continuing flap over the presence of Soviet combat troops in Cuba. "Without Cuba," one administration official said last night, "that vote never would have happened."

Sen. John Stennis (D-Miss.), the powerful chairman of the Armed Services Committee, tried to minimize the Cuban issue in arguing against commitments in the budget resolution to higher defense spending in future years. "These days will pass, and this little matter we're concerned about now will pass," Stennis said, apparently referring to the Cuban flap.

Sen. Edmund S. Muskie (D-Maine), chairman of the Budget Committee and an emotional opponent of the increased spending formula approved yesterday, blamed the SALT hearings for creating the new Senate mood. Revelations in those hearings about the "technical vulnerability of our Minuteman [land-based] missiles" in the 1980s had created a new atmosphere, Muskie said, noting that just a few months ago there was almost no serious talk of big increases in the defense budget.

In a stirring speech opposing the new proposed increases, Muskie said "the enemy that has the pouer to devastate" the United States in the near future "is not the Soviet Union. It is inflation."

But t,ere also were stirring speeches from proponents of the 5 percent increase in defense spending, and they won the day. "We're going backwards, that's uhat we're doing," shouted Ernest F. (Fritz) Hollings (D-S.C.), original author of the 5 percent proposal. Hollings repeatedly compared America in the late 1970s to Britain in the 1930s, implying as well that the Soviet Union today poses a threat comparable to Nazi Germany then.

"We in this country have gone to sleep on the assumption that we could end the arms race by slumbering it away," Nunn declared. Today, said Nunn, "there is only one country running in the race, and that happens to be the Soviet Union."

Nunn drew a bleak picture of American military capabilities, declaring that today the country's armed forces "are incapable" of meeting their declared objectives if conflict were to break out.

"Today," said Nunn, "the U.S. Army has on hand only about one-third of the ammunition and the equipment it needs to fulfill the national strategy requirement of being able to sustain simultaneously a major war in Europe and a minor contingency in the Middle East . . . ." He said the Army hasn't enough trucks to be effective, nor has the Marine Corps enough amphibious landing craft to fulfill its mission, nor has the Navy enough ships to prevent the Soviets from attaining clear naval superiority in the late 1980s.

"Even a 5 percent growth rate" in the defense budget "hill not be sufficient," Nunn told the Senate.

Muskie was the only member of the Senate to make a forceful effort to dispute the need for big increases in defense spending. A handful of others made pro-forma speeches against the idea.

Muskie said talk of a desperate decline in American military strength was exaggerated. He said that the United States and its North Atlantic Treaty Organization allies would spend $218 billion on defense in 1979, whereas the Soviet Union and its Warsaw Pact allies would spend $188 billion.

Muskie said he was much more upset by the relentless increase in the price of gold and the corresponding decline in the value of the dollar than he was by any imminent threat from the Soviet Union.

Roll Call Vote in Senate On 5% Increase for Pentagon

Here is the 55-to-42 roll call by which the Senate recommended 5 percent "real" increases in defense spending for fiscal 1981 and 1982.