On the inverse eigenvalue problem for T-alternating and T-palindromic matrix polynomials