Don’t choose the institute based on the city. As you will barely get to go out of the campus because of the academic loads in both the colleges.
IIM Bangalore offers the best student exchange programs. This college has helped a lot of students in building their careers. Most of the alumni of IIM Bangalore are settled abroad. So, it is definitely a good option for your studies. Also, it will take over 10 years for Bangalore to be completely unlivable. So, you don’t need to worry about that for the duration of your course.
However, if you want a pollution-free campus then IIM Kozhikode will be a better choice for you. The hostel rooms of this college are very good along with food. You will find a lot of learning opportunities over there.
Choose according to your convenience and don’t take City as a major parameter for your decision.