The repeal, a decades-long priority for public employee advocates, heads to the president for his signature after a late night Senate vote.