My best guess (and it's just a guess) is that one of the brothers bought a refundable ticket on UA,checked in to get past security, and then cancelled his reservation. The other brother then maybe printed his boarding pass twice so they both could use it. When the second one went to board, the scanner beeped that he already had gone past, which was probably dismissed as a glitch since there he was standing there with his passport matching the last name on the boarding pass. I don't know why they returned, but one advantage of doing so was that they could be arrested, since the "crime" occurred in the US before they boarded.