I can't help but wonder why the Confederacy, who desperately needs the good will of France in the 1860s would invade Mexico during Maximilian's reign. Geo-politically it makes little sense. Now, I'll concede, the fire eaters were rabidly expansionistic, and if they held control of the CSA government, it's possible they could overreach and piss off any good will from France or Maximilian Mexico. But I think any elections following victory wouldn't have favored the fire eaters. Despite popular misconceptions, the fire eaters were a fairly small minority and while they were the tail that wagged the dog in the lead-up to the civil war, I'm not convinced they would be able to hold power after independence.
Now, if the CSA in their infinite wisdom decided to invade Mexico before 1870, logistics would make such a venture anything but certain. There were less than 300 miles of railroad in Texas during the Civil war, and all of it was based around Galveston Bay. Mostly as a means of getting cotton to market. It's a long dusty march from Galveston to Laredo, and while it's certainly possible to support an army far away from your logistics base, it's not efficient or cheep. For the sake of giving the CSA a western base, let's say that General Sibley's New Mexico Campaign was better organized (or just luckier) and he decisively defeated Col. Canby and the union forces and let's say he's able to win any battles up to the Colorado River. A peace treaty that gives the CSA NM and AZ everything south and east of the Colorado River gives the CSA a lot of room to expand without another war, apart from what hell the Apache would make of their expansion into NM and AZ.
I think an interesting TL would be one in which the CSA survives but allies itself with Maximilian's Mexico (maybe Maximilian pivots toward the CSA when the French get their wallets handed to them by the Prussians). What would Mexico have looked like 20 or 30 years after, if Maximilian had survived and Juarez been defeated? What would it have looked like, if it were closely allied with a surviving CSA?