WASHINGTON — The Senate voted on Wednesday for a second time to terminate the national emergency that President Trump declared at the southwestern border, in a bipartisan rejection of Mr. Trump’s bid to build a wall without congressional approval.

But the 54-to-41 vote, in which 11 Republicans joined Democrats to break with the president over his signature domestic priority, fell short of the margin that would be needed to overcome a presidential veto, ensuring that Mr. Trump would be able to continue to redirect military funding to build a barrier on the southwestern border.

The tally was nearly identical to the result of a vote in March, when Congress first sought to block the national emergency declaration and a dozen Republicans joined all Democrats present for the vote. Senator Marco Rubio, Republican of Florida, who voted in March to overturn the emergency declaration, did not vote on Wednesday. Mr. Rubio had a previously scheduled family matter to attend to, but would have voted again to reject the emergency declaration, his office said.

Democrats who forced the vote knew at the start that they were unlikely to draw enough Republican support to overcome a certain veto by Mr. Trump, but they pursued it anyway in an effort to apply political pressure on Republicans. It confronted Republicans with a choice between breaking with a president who demands loyalty and preserving money Congress had set aside for military projects in their states, and sticking with Mr. Trump’s border wall, even at the expense of their own constituents.