What are the important factors I must consider while applying to a CS program for an MS after majoring as a mechanical engineer in my undergrad? I have a master's in mechanical engineering from a pretty decent college in my country with a GPA of 7.9/10. I'd like to know what constitutes a good application to a Master's program in CS (ML, to be precise) and how I must choose my Universities that are safe and in those I have a chance.
Overall, your MS in ME will be viewed positively when you apply for MS in CS with Machine Learning specialization.  What will matter most are how many computer science courses you have taken (and grades you received) and how many relevant math classes you have taken -- calculus, probability &amp; statistics, linear algebra, numerical methods, optimization.  The project work you have done in simulations could be very relevant and helpful, too, if the software you wrote was something more than procedural programming or deterministic simulation.

In your Statement of Purpose, it would be to your advantage to make a strong link between your ME education and work experience and your goals in CS-ML.  Are there applications or problems that arise in ME that you want to address with ML methods? Are there particular methods of optimization or classification that you've encountered in ME that you want to explore further in other settings?

Regarding what schools to which you might apply: I would suggest that you aim at CS departments that are part of an institution with a strong "engineering" culture or focus.  In the US there are many colleges, universities, and institutes that have an engineering focus, including the Polytechnics, Case Western Reserve, Harvey Mudd, Carnegie-Mellon, and many others.  In contrast, the CS departments at Yale, Harvard, etc. have less orientation toward engineering.