The vote cleared the way to enact major elements of President Trump’s domestic agenda and escalated a bitter fight among Republicans over what federal programs to shrink to finance major tax cuts.