Sorting machines are in fact used in these countries. But most of the trash separating efforts were introduced many decades ago, long before the capabilities of modern AI systems.
I would be more worried about the fact that a lot of the garbage that first gets separated ends up getting burned anyway because recycling is not even possible in a lot of cases.