WASHINGTON — The Senate on Wednesday approved a bipartisan plan that would tie interest rates for college student loans to the financial markets, bringing Congress close to finally resolving a dispute that caused rates to double on July 1.

But the 81-18 vote, which drew overwhelming support from Republicans, masked deep divisions among members of the Senate Democratic caucus. Seventeen of them voted “no.”

Many liberals, who are upset that the plan would replace the fixed-rate subsidized federal student loan program, criticized their colleagues for leaving lower- and middle-income students vulnerable to swings in the market.

As the bill was debated, a discordant scene played out as conservative Republicans like Richard M. Burr of North Carolina praised the Democrats they had worked with to strike a deal, and liberal senators like Elizabeth Warren, Democrat of Massachusetts, and Bernard Sanders, independent of Vermont, accused their colleagues of forcing through a bill that betrayed their party’s promises to working-class families.