A. Confederate General William Henry Chase Whiting, who grauated at the top of his class at West Point in 1845, held the record for the highest grades ever attained at West Point--a record that lasted until a new one was established by Douglas McArthur in 1903.
Edit - You would think that the question of who had the best academic record at West Point during the 19th century would have a fairly straightforward answer, but that doesn't seem to be the case.
Some players found a source indicating that Charles Mason and Robert E. Lee had the two best records in the 19th century. According to this source, Lee would be the Civil War officer with the best record, since Mason did not serve in the Civil War.
Other players found a source indicating that Irving Hale of the Class of 1884 had the best record in the 19th century, and that, in fact, none of those with the five best records served in the Civil War.
Players who answered Robert E. Lee or players who were obviously confused by the fact that apparently Hale had a higher average than any Civil War officer will get credit for correct answers, since sources have been provided in support of each of these.
Hoosier