Observation of the $\chi_\mathrm{b1}$(3P) and $\chi_\mathrm{b2}$(3P) and measurement of their masses