The worth and credibility of any department of a particular institute can be determined by the faculty pool of that concerned department. Generally,
The Mechanical Engineering department of IIT Hyderabad specifically, has an extensive faculty pool of many professors that are specialties in diverse fields. IIT Gandhinagar’s Mechanical Engineering department isn't necessarily inferior, but a major part of the faculty pool comprises temporary visiting professors.
Thus for Mechanical Engineering, IIT Hyderabad is a better option than IIT Gandhinagar.