The Posse Comitatus Act only applies to the use of the military against citizens, it does not apply to illegal aliens or foreign combatants on U.S. soil or U.S. territorial waters.
In any case, the military cannot make arrests except on property under the exclusive jurisdiction of the U.S. On the border, the Army could only detain and wait for law enforcement personnel to make arrests.