The result set up a Round of 16 berth for Mexico against the Netherlands in Fortaleza June 29 while Croatia were eliminated from the tournament, reports Xinhua.
Hernandez had an immediate impact after replacing Giovani dos Santos just after hour. Minutes after his introduction, Rafael Marquez scored with a header before Hernandez's pass to Oribe Peralta set up Andres Guardado for Mexico's second goal. Hernandez then completed the rout by heading in at the far post eight minutes from time.
"We needed someone who would revolutionize (our game)," Herrera said. "Javier did a very good job, he came in, held the ball and did very well and even got a goal which was great."
"We know he gives everything. We are very happy with his attitude today and all the time."
The goal was Hernandez's first for the national team since the Confederations Cup last June.
After a frustrating season at Manchester United, in which he failed to earn a regular starting berth under David Moyes, the 26-year-old admitted to feeling a mix of relief and jubilation at Pernambuco Arena.
"Few people have believed in me," he said. "Today I showed that I won't lose my confidence and that I can still achieve my goals."
Asked how far Mexico could go in the tournament, Hernandez adopted a cautious tone.
"Winning this match doesn't mean we are going to win the World Cup. We have to show respect and humility. We will enjoy today and then think about the Netherlands," he added.