Vote of 60-40 breaks six-week stalemate after a small group of Democrats ratified deal with Republicans