Both teams had already been eliminated after losing their opening two Group A matches but the win may easy the pressure slightly on Mexico coach Jose Manuel de la Torre, whose team have also been unimpressive in the World Cup qualifiers.
Hernandez, who scored all three of Mexico's goals at the tournament, put his side ahead in the 54th minute when he met Andres Guardado's cross with a perfectly timed run and placed his header past Eiji Kawashima.
He struck again 12 minutes later from close range after Hiram Mier flicked on a corner at the near post.
Shinji Okazaki tapped in with four minutes left to give Japan some hope of claiming their first point, but Mexico should have restored their two-goal lead when they were awarded a penalty for a foul on Hernandez.
The striker was guilty of a double miss as his kick was saved by Kawashima and he then hit the crossbar from the rebound.
Mexico deserved the win overall with Guardado also hitting the post with a flying header five minutes before halftime.
- Sports & Recreation
- Andres Guardado