Owner says it is a staged scene possibly taken in 1862: "The 'Cameron Highlanders' of the 79th New York are reprising their roles as pickets during their reconnaissance of Lewinsville, Virginia on Sept. 11, 1861." So are the captured men possibly just civilians or else Confederate soldiers/spies/sympathizers captured somewhere else...
Source.
Cowan's says that the prisoners are rebel spies.
Also taken at the same tree/shelter:
Source.
Which was then the inspiration for this Albert Bierstadt painting titled "Guerrilla Warfare":
Source.