For some of these languages, it's not transliteration, it's just how the language is written! Very few Mesoamerican languages were ever written in anything except the Latin alphabet, and nowadays it's (as far as I know) completely universal. So the goal of the spelling xochitl is to make sense to Nahuatl-speakers, not to English-speakers.
For other languages, like Mandarin, the goal is to represent all the sounds of the language unambiguously in the Latin alphabet. Mandarin has two sounds that are fairly similar to the English "sh", and the difference between them is important (see the comments for examples). So one of them is transliterated as sh, the other as x, to preserve that distinction.
As for why x was chosen for that sound in Nahuatl in the first place—the modern Nahuatl orthography is descended from systems invented by Spanish-speaking colonizers. And at that point, Spanish had a sound very close to English "sh", spelled with an x (as in Old Spanish baxo "low", which became Modern Spanish bajo). So when the conquistadors needed a way to spell a similar sound in Nahuatl, they used the letter they were familiar with.
P.S. I'm assuming the chips are named from the Nahuatl word xōchitl "flower"; the Classical Nahuatl pronunciation would be something like "SHOH-cheet". That's why I talk about x being pronounced like English "sh".