When a small, scrappy Mexican force handed the French army a surprise defeat in 1862, the Confederacy was denied a potential ally in the Civil War.