One for all the mexicans, how do you have so many of some classes (K, J, D3 for example) preserved but so little of so many other classes (S, X, N, H)
For starters, there two groups; operational locos, and preserved static units.
With the exception of the S class, every other one on your list has at least one static exhibit preserved. The four S class were summarily scrapped in an act of gross official vandalism, said to have been because the B class diesels were inferior in performance on the Spirit of Progress to the S steamers.
Next; there's only one H anyway, and it survives. DO NOT, UNDER ANY CIRCUMSTANCES, ASK WHY IT CANNOT BE MADE OPERATIONAL OR GAUGE-CONVERTED! It can't; it won't, and we've been through it a million times.
Operational locos depended upon availability; you got what you could after fighting your way past the scrappers' torches. R class and J class were relatively new, K's were so reliable that there were several of them available, and some determined groups managed to rebuild a D3 and, more recently, an A2.
Others will no doubt be able to add more detail.