Assuming you want to go for M.Tech through Gate so yes, you can write Gate exam in any discipline but there is no surety that PSUs and Colleges consider ME branch so there will be no benefit as M.Tech does not work stream wise as this is completely based on specialization. I would say better to stick with your branch and give your best in it and ME also has good scope in future so you can go for the same. Good Luck!!!
If you want to go through GATE 2018 then you can give the exam with any of the stream but I would suggest you to go with same stream because some PSUs consider only same stream as in BE. For further updated information about GATE 2018 you can go through with given below link.
GATE 2018
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile