Read up on a bit on American history. You will be surprised how diverse the Western frontier was after the civil war. Not just freed slaves, but well trained buffalo soldiers (some characters in above trailer look and dress like former buffalos).
Frontier was number one trip people made to get new starts. And unsettled areas like the new west had less prejudice compared to settled big towns, when the main goal was survival. The cluster of people made it mixed bag as a practical consequence (sometimes especially amongst outlaws, which is allways the focus of movies).
Also the menial job and skillset of a cowboy (cattle herding, not just John Wayneing outlaws lol) is as blue collar as they come, and who was most likely to be called "boy" in those days


.
No but seriously, Hollywood perception aside,quite likely post civil war that 1 in 4 amongst cowboys were of colour on sheer job opportunity alone (in texas during civil war, the slaves were left to run the ranches, crash course in skillset of a cowboy). Or way before that with Mexican vaqueros, who are the first original cowboys.