The five-year deal, with wage increases and new protections for working in high temperatures, covers 340,000 employees and could boost other labor efforts across the country.