The agreement, which includes salary increases of nearly 16 percent over three years, ends months of tense negotiations.