Raman scattering investigations of Jahn-Teller induced phase transitions in TmAsO4 and TmVO4