Each game has a 4th official who would replace the referee, and a reserve assistant. This makes absolute sense as most of the referees won't have waved a flag for decades, so asking them to go on the line in a World Cup final game would be a huge risk. The same has been done on English cup finals for a few years.