Is this joke racist against Native Americans

Of course, there’s also the fact that the Lone Ranger always left Tonto to get his arse kicked, so I always saw the joke as a “getting even” sort of thing, not racist at all.

I originally heard the “Cowboys and Muslims” joke as “Cowboys and N-----s,” so there’s no way I could think of it as anything but racist.