Vibration–rotational spectroscopy of XH2 and XH3 type molecules near the local mode limit