Hernandez, the Galaxy's big-name striker from Mexico, scored in the 11th and 50th minutes for the Galaxy, who have won three of their last four games.
The Galaxy have won both meetings against San Jose, with one match to go against their California Clasico rivals. The Earthquakes are winless in their last seven games (0-6-1) and have scored only two goals in that span.
Hernandez's first goal saw him slashing into the box, getting on the end of a cross from Samuel Grandsir and sliding a re-direct into the net. In the 50th minute, he scored his Major League Soccer-leading 10th goal of the season off a run to the goal and pass from Kevin Cabral.
In the 30th minute, the Galaxy had a chance to add to their 1-0 lead. Cabral found Grandsir with a pass into the box off the breakout, but Grandsir's shot just missed the net.
The Earthquakes had no shots on goal in the first half, but Javier Lopez hit the bar with a shot early in the second half.
Each team finished with 13 shots and three shots on target, and San Jose maintained possession for 63 percent of the match.
The Earthquakes also finished with 600 passes to 361 for the Galaxy, and with 89 percent pass accuracy to 80 percent for Los Angeles.