The pursuit of high-${T}_{c}$ superconductors has remained a long-thought goal within the field of condensed-matter physics and material science. Motivated by the recent experimental synthesis of $\mathrm{Sr}{\mathrm{H}}_{22}$ and $\mathrm{Hf}{\mathrm{H}}_{14}$, here we use ab initio methods to study the phase diagram, electronic properties, lattice dynamics, and superconductivity of the ternary Sr-Hf-H system. Several stable and metastable hydrides are predicted, including $P4/mmm\ensuremath{-}\mathrm{SrHf}{\mathrm{H}}_{16}, P\overline{6}m2\ensuremath{-}\mathrm{SrHf}{\mathrm{H}}_{18}$, and $P\overline{6}m2\ensuremath{-}\mathrm{SrHf}{\mathrm{H}}_{19}$. Furthermore, the isomorphic $\mathrm{SrZr}{\mathrm{H}}_{x}$ ($x=16$, 18, and 19) is obtained by replacing Hf with Zr. Among all these ternary hydrides, hydrogen atoms form cages around the metal atoms. At 280 GPa, the calculations of electronic and phonon properties reveal that the van Hove singularity in the electronic density of states near the Fermi level plays a key role in the superconductivity of $\mathrm{Sr}(\mathrm{Hf},\phantom{\rule{0.16em}{0ex}}\mathrm{Zr}){\mathrm{H}}_{18}$, and the ${T}_{c}$ are 257 and 261 K, respectively. Our research may pave the way for finding high-${T}_{c}$ superconductors in ternary hydrides.