The Senate approved a deal to end the nation's longest-ever government shutdown, putting Congress on the brink of resolving a weeks-long fight.