Ryo Hirakawa will race for Haas at the Mexico City Grand Prix, replacing Esteban Ocon.