Impact of hydrogen absorption on crystal structure and magnetic properties of RE2T2X compounds