Read this and answer the question

After running imperial military affairs in the states of Coahuila and Durango, General Agustín Enrique Brincourt made preparations to invade the state of Chihuahua. On July 8, 1865 Brincourt crossed the Nazas River in northern Durango, heading toward Chihuahua. On July 22 Brincourt crossed the banks of Río Florido into Ciudad Jiménez; one day later he arrived at Valle de Allende where he sent Colonel Pyot with a garrison to take control of Hidalgo del Parral. Brincourt continued through Santa Rosalia de Camargo and Santa Cruz de Rosales. President Juárez remained in the state capital until August 5, 1865 when he left for El Paso del Norte (present-day Ciudad Juárez) due to evidence that the French were to attack the city. On the same day, the President named General Manuel Ojinaga the new governor and placed him in charge of all the republican forces. Meanwhile, General Villagran surprised the imperial forces in control of Hidalgo de Parral; after a short two-hour battle, Colonel Pyot was defeated and forced to retreat. At the Battle of Parral, the French lost 55 men to the Republican forces. On August 13, 1865, the French forces with an estimated 2,500 men arrived at the outskirts of Chihuahua City, and on August 15, 1865, General Brincourt defeated the republican forces, taking control of the state capital. Brincourt designated Tomás Zuloaga as Prefect of Chihuahua. Fearing the French would continue their campaign to El Paso del Norte, President Juárez relocated to El Carrizal, a secluded place in the mountains near El Paso del Norte, in August 1865, . It would have been easy for the French forces to continue in pursuit of President Juárez across the border, but they feared altercations with American forces. General François Achille Bazaine ordered the French troops to retreat back to the state of Durango after only reaching a point one days travel north of Chihuahua City. General Brincourt asked for 1,000 men to be left behind to help maintain control over the state, but his request was denied. After the death of General Ojinaga, the Republican government declared General Villagran in charge of the fight against the Imperial forces. The French left the state on October 29, 1865. President Juárez returned to Chihuahua City on November 20, 1865 and remained in the city until December 9, 1865 when he returned to El Paso del Norte. Shortly after the president left Chihuahua City, Terrazas was restored as governor of the state on December 11, 1865.

Who surprised the imperial forces in control of Hidalgo?
General Villagran