Maximillian wanted to help Juarez. He didn't care much for the French tactics either. He was truly caught between a rock and a hard place. Carlota went insane during this time. Maximilian was executed by firing squad, by Juarez's army, but I'm not sure this was directed by Juarez, who was working with Maximilian to a certain extent through admiration. Maximilian was not a bad guy.
Les