The rank of corporal was a bit of a slippery slope. Corporals were put into line by height yes but in the color guard there is language that implies their assignment was by "ranking corporals". Of course since the OP has not yet clarified or may not know what company their ancestor was in we are shooting in the dark.
From the post cited by me above and taken from: INFANTRY TACTICS TITLE I ARTICLE I,
FORMATION OF THE INFANTRY IN ORDER OF BATTLE supplied by Mr. M E Wolf.
In regards to the Color Guard (aka the company that carries the flags.)
"The front rank will be composed of a sergeant, to be selected by the colonel, who will be called, for the time, color-bearer , with the two ranking corporals, respectively on his right and left; the rear rank will be composed of the three corporals next in rank; and the three remaining corporals will be posted in the rear, and on the line of file closers. The left guide of the color-company, when these three last named corporals are in the rank of file closers, will be immediately on their left."
This passage does not specifically say these "ranking corporals" are 1st or 2nd corporals per se but that is my interpretation. The argument could be made that rank meant height but why not say so.
Also taken from Mr. M E Wolf's post but from "Hardee's Rifle & Infantry Tactics- School of the Soldier"
The formation of a regiment is in two ranks; and each company will be formed into two ranks in the following order: the corporals will be posted in the front rank, and on the right and left of platoons, according to height; the tallest corporal and the tallest man will form the first file, the next tallest man will form the second file. and so on to the the last file which will be composed of the shortest corporal and the shortest man.
The information supplied in the manuals depending on which was used could be confusing to say the least.