Well, now the argument of bad luck comes back. The great "New Economic Geographer" Gordon Hanson writes (via MR) in Why Mexico is not Rich? that the reason behind Mexico's misfortune is that its specialization pattern lies in goods similar to those of China.
China’s size, high rate of growth, and increasing outward orientation mean that its emergence is surely changing international prices, improving the terms of trade for countries that produce its importables and deteriorating the terms of trade for countries that produce its exportables. Mexico fits squarely in the latter camp, whereas Argentina, Brazil, Chile, Colombia, and Peru fit in the former.