Unfortunately the nature of a ranching operation precludes a walled compund for safety. Besides such "protection" would be illusory since they might serve to keep victims inside if a determined force were to penetrate the perimeter to mete out some border retaliation...
A far more workable solution is to recruit the ranchers as "in place" recon units. Give them military radios and night vision gear and the training to use that equipment. With the national guard on standby, a rancher sighting a large group of illegals with maybe a covering force made up of MS 13 or the Mexican Army...could simply radio in the sighting without anybody being the wiser. Then a swift reaction force of Apaches and Bradley's could respond.
The US Border Patrol is forced to withdraw in the face of Humvees mounting M2HB 50's because they're outgunned and of course subject to STUPID Rules of Engagement imposed by the feds. I wonder how the shoe would feel on that other foot across the border when a flight of Apaches screams in to politely inquire if they need directions back to Mexico City?
The only way I care to have our military ask questions of well armed intruders is with a note taped to the tip of a Hellfire missile.
As far as I'm concerned, armed border incursions should be regarded as an act of war.