Liquification of gas to liquid at critical temperature
Good question.  I think you got the right answer but by using some pretty suspect logic.  

First, there isn't enough information to solve the problem in general because pressure isn't specified.  Is the cooling of the gas isobaric?  Or adiabatic?  Or ... ?  Let's assume its isobaric, i.e., it happens at constant pressure.  If so, what's the pressure?  If the pressure is below 5.1 atm, then $\ce{CO2}$ will never condense into a liquid, instead it would transition directly to a solid phase (dry ice).  Ammonia's triple point is roughly 0.06 atm.  But your question says "cooled to the critical temperature", which implies not below the critical temperature, which means the only way any of them will liquefy is if the pressure is at or above the critical pressure.  So let's assume the pressure is isobaric and is at least 11.8 MPa, the critical pressure of ammonia, the gas with the highest critical pressure among the possibilities.  But if we do that, the question is easy.  The gas that liquefies first is the gas with the highest critical temperature, which would be ammonia.

Relaxing this assumption makes the question much harder.  Complex calculations would be required.  The theory of corresponding states would likely be useful.

Your logic is OK, but in your equation, $w$, the weight, and $V_c$, the critical volume, also vary.   So the statement that


  $T_c$  is directly proportional to $M$


is not true, because the other factors are not constant.$%edit$