It is a small error, and it is a work of fiction, but I too am puzzled that, if a writer is going to put in little details, he doesn't make a little effort to get them right. If the fellow knows the brigade and division, and knows that Confederate troops could have been captured at the railroad cut, he obviously using some historical reference, so why not use it? It wouldn't affect the scene if the prisoners were from say the 42nd Miss.
I ran across an example recently in The Churchill Factor by Boris Johnson. Writing about D-Day, he mentions the 12" guns of HMS Belfast. Belfast of course carried 6" guns; in fact there were no 12" guns anywhere in the Royal Navy at that time. There's no actual need in the narrative to mention the ship's gun caliber, but if you are going to mention it, why not get it right?
Belfast, incidentally, is now a museum ship moored in London, of which Johnson is the current mayor.