Rankings are not important. Nonetheless I just looked up the QS rankings worldwide for CS. In the 2021 rankings McGill and EPFL are both highly ranked and are not ranked all that far apart. In the 2023 rankings the difference is a bit greater, but they are still both ranked quite well (there are a lot of very good CS programs worldwide). I do not think that the difference matters.
Two questions come to mind.
One is where do you want to work after graduation? Are you potentially interested in working in Canada, or is Europe more likely? I do understand that both of these schools will be relatively well known in both Canada and Europe. However, there may be some advantages of studying in the same location that you will want to work, such as companies recruiting on campus.
The other question is: Where do you want to live for four years? Montreal is an attractive location and there is a lot to do right there around the McGill campus. I do not know Lausanne at all.
I did get a master’s at a well ranked university in the US, and there were students there who had graduated from a very wide range of undergraduate universities. Most were Americans from American universities. Admissions is tougher for an international student. However, I think that either McGill or EPFL will be well recognized by the top schools in the US.
If you ultimately want to end up in the US, one issue is that immigration to the US is tough to predict this far in advance. Also, if you end up getting a permanent resident visa or citizenship in the US then you had better be pretty sure that you want to stay here permanently. The US feels it has the right to keep taxing US permanent residents and US citizens even after they have left the US and gone to live and work somewhere else. However, I am pretty sure that the taxation issue is not a problem if you just want to get a temporary visa to work here for a year after getting a master’s in the US (I have talked to a few people who have done exactly that).
I do not know all that much about EPFL. Based on what I have heard, I think that these are both very good universities and you will get a very good education at either of them.
One thing that you might do is to look at what the graduation requirements are for each school. I have noticed that for a bachelor’s degree universities in Canada tend to at least allow more classes in your major or related fields and have fewer unrelated requirements compared to universities in the US. I do not know how universities in Europe compare with this, although my wild guess is that they are closer to the Canadian model.
One last note: For internships in Montreal, being fluently bilingual in French and English is very useful. However, I expect that you already have this fully covered!