I think IIT Gandhinagar MTech is a safer option to go with than a direct Ph.D. from IIT Patna. IIT Gandhinagar provides better learning experiences and opportunities to explore than IIT Patna. IIT Gandhinagar CSE faculty is exceptionally good and will help you if you are willing to do Ph.D. after MTech.
Unlike PhD and MTech guarantees a degree within 2 years and so if you end up changing your mind later you will not have wasted 5-6 years. You can decide whether to do Ph.D. or not while pursuing your MTech and play safe.
The overall academic experience and campus life are better at IIT Gandhinagar than at IIT Patna. Be it the food, facilities, faculty, alumni, or placements, IIT Gandhinagar has it all.