Hm. Even if it was just a war between Mexico and the United States, you'd really have to consider why they would fight each other.
The reason why the United States declared a war against the Confederate States was over the purchase of Sonora and Chihuahua from the Mexican Empire. The Mexican Hapsburgs were strapped for cash trying to maintain power in Mexico since Napoleon III's intervention succeeded in propping him up. The Mexican Emperor and his government needed money and the Confederacy wanted to expand its territory westward to have access to the Pacific ocean, much like the United States had access to the Pacific via California through San Francisco. And while Baja California is in the way and may create a possible choke-point for the Mexicans to exploit, the Confederacy is in a much more powerful, stable position than Mexico and the two countries are very closely allied with each other. I doubt the Mexican Emperor would risk a war with the Confederacy just to extort them over more money, especially since I don't believe they have the means to really do so.
The only reasons I can see the US and The Mexican Empire duking it out one-on-one would be over serious border clashes or border disputes near southern California and the New Mexico, either over indian tribes crossing open borders or over disagreements with how to draw a line between what was who's. Remember this war takes place in 1881, a time where states weren't really states yet and patrolling the frontiers here were fairly hard.
Either way I don't believe the Confederacy would just let their closest neighbor and ally be attacked by the US without a say. The Mexican Empire is too weak to take on the US in this timeline, so I don't believe they'd be the aggressor. The US would probably be the most likely candidate to escalate things invade Mexico over land, but what would they be taking? Baja California? Sonora?
Well... I can see the US declaring war on Mexico to pre-empt any attempt of the Confederacy to buy Sonora and Chihuahua, but then they'd risk seriously angering the French and the British. After all the Monroe Doctrine is a joke in the timeline and and the US is not in a strong position to really wave its big stick around without offending the Confederacy, the British, and the French. Especially the French actually. Napoleon III would not like that.
So if the US goes to war with Mexico exclusively and the Confederacy doesn't get involved, it still has to go to war with France and British Empire. They're not going to let the US just attack Mexico. They're the big players in this world, the Great Powers with the big empires that see everything.