Citizen's legally carrying guns can only use them for protection. They cannot use them for tools to enforce a citizen's arrest or impose their will on another. To perform a citizen's arrest the crime almost always has to be a felony that you just saw committed. You can use reasonable force to detain someone but pointing or displaying a gun to perform the citizen's arrest is illegal. You can pretty much only detain someone at gunpoint if you are in your own home, they have no legal reason to be there, and you are reasonably and legitimately fearful of your safety. And just saying your were in fear doesn't make it reasonable so.
Was what these idiots did legal? Probably not if they use firearms displayed or pointed at the immigrants to effect the citizen's arrest. And they would have had to firsthand witness a felony crime, if illegal immigration is even a felony, and not been able to call the real boarder patrol to deal with the situation. That's why most citizen boarder patrols don't make contact with the immigrants and only report their location and stand as witnesses to the illegal crossing. You can't make a citizen's arrest if the properly authorized authorities are available to deal with it.
Citizen arrests are perfectly legal, but only under very specific circumstances. And if done wrong or mistakenly can open you to charges like kidnapping, false imprisonment, assault and such. Basically, never use force or brandish a gun unless you are in reasonable fear of immediate great bodily harm to yourself or others, and you have done what you reasonable can to avoid it. You can't arm yourself and go looking for trouble with the intent of using the weapon to enforce a citizen's arrest.
And just because it's technically legal for you to do something (which I'm not saying this incident was legal) that doesn't mean you should.
EDIT: And if it's true the group was yelling ""Policía, alto!" then they are rightfully screwed.