Mexico had more chances and more possession but their defence left wide open spaces which were ruthlessly exploited by Germany’s young, experimental team.
Goretzka struck twice in the first eight minutes before Timo Werner and Amin Younis added two more in the second half, though Marcio Fabian’s 89th minute goal for Mexico was the most spectacular — a viciously swerving drive from 35 metres.
Germany, whose starting team had an average age of just under 24, will meet Chile in Sunday’s final in St Petersburg, having progressed despite resting players such as keeper Manuel Neuer, Mats Hummels, Mesut Ozil, Thomas Muller and Toni Kroos.
Mexico’s elimination will leave the fans wondering about their chances at next year’s World Cup if, as expected, they qualify, and of ending a run of six successive last 16 exits.
There was controversy after the break when Werner appeared to be pushed in the back as he broke into the penalty area but the referee waved play on without asking for a video replay.
Germany went ahead after six minutes when Benjamin Henrichs burst down the right and Goretzka swept his low pass into the net from the edge of the penalty area
It took one minute 49 seconds for Germany to double their lead as Werner slipped the ball through an open Mexico defence to Goretzka who clipped it over keeper Guillermo Ochoa.
Mexico looked to be on course for a repeat of their 7-0 loss to Chile at last year’s Copa Centenario and could have gone three behind when Werner broke clear but Ochoa blocked his shot.
Mexico had 58 percent of possession and 25 goal attempts to Germany’s 12 but wasted their openings.
By contrast, Germany were clinical and struck again when their 23-year-old captain Julian Draxler, their most experienced player with 34 caps, slipped the ball to Jonas Hector whose pass into the area was turned in by Werner in the 59th minute
Mexico bravely continued to push forward and Raul Jimenez headed against the bar. Fabian’s goal gave them brief hope of a comeback, which was soon ended by Younis with Germany’s fourth.
(Writing by Brian Homewood; Editing by Ken Ferris)