Hello Sameer,
Yes, definitely you can do mtech in cse after pursuing BE in mechanical. You will have to appear for gate exam and have to score good marks to get admission in IIT for mtech.
Also you should meet the eligibility criteria that is to score 50% in your graduation.
All the best.
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile