They cause the levitation of the train.
In fact, magnets with same polarity repel each other. So, the magnets on the tops of the rails repel the magnets on the botton of the train: this repulsive force is strong enough to win the weight of the train, and the train levitates in air. As a consequence, the frictional forces acting on the train are very small compared to the forces experienced by normal trains (that should win the frictional forces of the railway), and therefore this Maglev train can reach a huge speed.