Senate Republicans, voting 54 to 45 with only two defections, yesterday defeated a last-ditch attempt by the Democratic minority to put a stamp of "fairness and equity" on the $21 million tax bill.

The Democrats had sought to eliminate a 1983 tax cut for those with incomes above $78,000, to restore Medicare cuts and to reject tax hikes on cigarettes and telephone usage.

The vote was the first of what apparently will be two key tests for legislation that would raise taxes by $98 billion over three years and cut social spending, particularly in the Medicare program, by $17.5 billion.

Although it was clearly a GOP legislative victory, Democrats plan to cite the vote during this year's election campaigns. They plan to argue that Republicans refused to raise the taxes of the rich although they increased Medicare costs for the elderly and forced enactment of broad-based taxes on cigarette smokers and telephone users.

The second major test of the legislation, which represents the largest tax hike in peacetime history, is scheduled this afternoon on a section of the bill that would require a 10 percent withholding tax on interest and dividend income.

As many as five Republicans are threatening to bolt on this provision, which is strongly opposed by the banking and savings and loan industries. It is the single most important part of the tax increase package, however, providing $12 billion over three years.

After defeating the Democratic amendment, sponsored by Bill Bradley (N.J.) with the backing of the Democratic caucus, Republicans rejected, 53 to 46, another proposal aimed specifically at easing some of the Medicare cuts.

The proposal, sponsored by Max Baucus (D-Mont.), would have eliminated plans to have Medicare recipients pay $2 for each home visit, pay higher premium costs and pay more on their own before the federal program takes over the cost.

The Baucus amendment did have the backing of seven Republicans, however, and failed only because four conservative Democrats and Harry F. Byrd Jr. (Ind.-Va.) joined the GOP majority. In addition, pressure for the Baucus amendment was lessened with the knowledge that Republicans would support a modified version sponsored by David F. Durenberger (R-Minn.) and later passed unanimously.

The Durenberger amendment would make the first 20 home visits by a doctor or nurse free and ease the increased costs to be covered by the beneficiary before Medicare takes over. In dollar terms, the Durenberger amendment reduces Medicare cuts by about $1 billion over three years, compared to the $1.4 billion under the Baucus proposal.

Under the failed Bradley-Democratic amendment, all taxpayers with prededuction incomes of $78,000 would not receive the 10 percent tax cut scheduled next July 1 until the federal budget is balanced.

For those with prededuction gross incomes between $46,500 and $78,000, a steadily increasing share of the cut would have been postponed until achievement of a balanced budget. For all below $46,500, the full cut would remain. Even the administration does not foresee a balanced budget for at least three years.

"Is it too much to ask those individuals who make more than $78,000 a year to defer their tax cut until the budget is balanced?" Bradley asked his colleagues. "I would argue that it is not too much to ask and, if this bill is about fairness, then this is the fairness amendment."

Republicans, particularly Finance Committee Chairman Robert J. Dole (Kan.), have argued that the tax bill, which closes many tax breaks for corporations and the wealthy, is a key element in a GOP effort to regain an image of "fairness and equity."

The 1981 tax bill, which was skewed in favor of the rich, and the budget cuts, which fell most heavily on the poor, provoked a strong public response in which the GOP and the administration were seen as favoring the well-to-do at the expense of the lower middle class and the poor.

Republicans did not put up a strong rhetorical fight against the Bradley amendment, as Dole commented: "I have no argument with the amendment. I know it is offered for good, valid political reasons . . . . Republicans would do the same."

He pointed out, however, that any backing off from the 1983 individual tax cut would prompt President Reagan to veto the bill.

While Democrats were struggling to regain their posture as proponents of fairness and equity, the amendment that received the most votes yesterday was backed by two major business organizations, the Chamber of Commerce and the National Federation of Independent Business. It failed, 51 to 48.

Sponsored by Lloyd Bentsen (D-Tex.), the amendment would have eliminated a proposed increase in the federal unemployment tax paid by businesses. Four Republicans backed it.

Area senators voted along party lines, although one of the GOP defectors to Bentsen was John W. Warner (R-Va.).

Democrats on the House Ways and Means Committee, meeting in closed session, took up outlines of a tax bill that generally followed terms set in the Senate measure, although sources said the House proposal included repeal of $11 billion worth of tax breaks enacted last year for the oil industry. The House proposal is subject to extensive amendment this week.