Once the French had taken Mexico City in 1863, the war developed into a small border engagement in the northern regions of Mexico. The populated areas of central Mexico, including the important harbor of Veracruz, were very much under the control of the Imperial government. What stopped Maximilian from gaining complete control over his country was Juarez' ability to retreat his troops into American territory when necessary, and the end of the Civil War that forced France to withdraw his troops, leaving Maximilian to his own means whole fighting an armed insurrection supported by the US.Defeating the Mexican Army at Puebla, and actually destroying it are two totally different things. The French might've forced the Mexicans to retreat, but trapping, and capturing the much larger Mexican Army would've been all but impossible. Interesting that you call the pro Republican Mexicans rebels. Juarez was the legally elected president of Mexico. Calling the Juarez Forces rebels is like the Confederates calling the Union Forces rebels.
A quick look on a map shows that the Expédition du Mexique wasn't a hopeless operation doomed to fail, but a civil war between Mexican conservatives and liberals supported by two different foreign powers, with the side retaining international support winning in the end.