There's a little more to the story. Loughlin served in Co. "F", 2nd Battalion, Waul's Texas Legion. 'Capt. Rigby' should be James Wrigley, later Lieut. Col. of the 2nd Battalion. The first and second battalions were infantry.
Loughlin received his parole at Vicksburg MS on July 9, 1863, but elected to return to Federal lines and was sent to prison at Camp Morton IN. On Dec. 5, 1864, Loughlin asked to take the oath of allegiance to the U.S., "a loyal Irishman to the Government."
Copies of his military service file are available here --