I’m a native speaker and the original phrasing was fine and sounds like completely correct idiomatic English to me.
Yes, the syntax is ambiguous, but ambiguously-parseable sentences happen all the time in all languages and we resolve the ambiguity using context clues, which in this case is easy to do.
The phrasing is correct and pretty normal, it’s just potentially ambiguous. English is like that sometimes. I’m not a grammarian, but I think “I counted all the yurts in Mongolia using machine learning” would normally be interpreted correctly by most people, with ‘using’ referring to the subject ‘I’. The way you’d write the other interpretation is “I counted all the yurts in Mongolia that use machine learning”. Your proposed alternative is also correct and less ambiguous.
As another commenter said, the phrasing isn't wrong, just ambiguous. I would add the word "by" to make it unambiguous: "I counted all of the yurts in Mongolia by using machine learning."
"I counted all of the yurts in Mongolia using machine learning"
It's not wrong, but possibly ambiguous, and I'd bet an English teacher would prefer it was phrased differently. In speech, I wouldn't bat an eye at that arrangement. But, if I were to write the headline, it would have been...
"I used machine learning to count all the yurts in Mongolia."
The quick fix without changing the sentence structure is to insert "by" before "using". Colloquial speech often omits it but it's implicit here. The other option is to switch to active voice.