The Germans opened the scoring early, with Leon Gortetzka making it 1-0 just six minutes into the game. Benjamin Henrichs squared the ball to Goretzka at the top of the box and he sent it past Guillermo Ochoa to give Germany the lead.
Goretzka added a second less than two minutes later as he ran on to a through ball from Timo Werner and beat Ochoa with a shot to the far post, giving Germany the 2-0 lead in the 8th minute.
Werner then nearly made it 3-0 in the 19th minute, but that time Ochoa was able to make the save. It took Mexico a while to recover from the shock of those two early goals, but after the half-hour mark they began to find a few chances of their own.
Marc-Andre Ter Stegen made a double save on the Dos Santos brothers, denying first Giovani and then Jonathan, two minutes before Javier Hernández had a chance from six yards but put his shot over the bar.
In the second half, Werner made it 3-0 in the 59th minute when, unmarked at the top of the six-yard box, he finished off a short pass from Jonas Hector.
Mexico had a few chances to reduce the deficit, with Marco Fabián hitting the side netting, Ter Stegen saving a good attempt from Miguel Layún, and Raúl Jiménez hitting the crossbar, before they finally found the breakthrough in the 89th minute.
Fabián provided the consolation goal for El Tri with a long-range shot following a set piece, but it took Germany just minutes to restore their three-goal lead.
In stoppage time, substitute Amin Younes converted a tap-in to make the final score Germany 4, Mexico 1.
With the 4-1 win, Germany advances to the final against Chile while Mexico will play Portugal for third place.
Germany: Marc-Andre Ter Stegen, Antonio Rüdiger, Matthias Ginter, Joshua Kimmich, Sebastian Rudy, Leon Goretzka (Emre Can 67′), Jonas Hector, Benjamin Henrichs, Timo Werner, Julian Draxler (Amin Younes 81′), Lars Stindl (Julian Brandt 79′).
Mexico: Guillermo Ochoa, Héctor Moreno, Néstor Araujo, Oswaldo Alanís, Miguel Layún, Giovani dos Santos (Marco Fabián 63′), Héctor Herrera, Jonathan dos Santos (Rafael Márquez 67′), Javier Hernández, Javier Aquino (Hirving Lozano 45′), Raúl Jiménez.