Carlos Sainz took pole position for the Mexico Grand Prix.