The Laboratory for Applied Superconductivity of the Federal University of Rio de Janeiro (LASUP) has been developing a superconducting magnetic levitation urban train named MagLev-Cobra. It is a kind of light rail vehicle where the conventional wheel-rail track is substituted by a rail of Ne-Fe-B magnets and carbon steel interacting with superconductor bulks installed in the vehicle to promote levitation. The main cost of this levitation system is the magnetic rail. Therefore, any improvement in the shape and configuration of magnets and iron has a significant budgetary impact. In this paper, the optimizations carried out with the feasible direction interior point algorithm, extensive search, and genetic algorithm of magnetic rails are presented. The objective is to find the geometry that minimizes the total cost, for a given levitation force, considering some practical restrictions. The levitation force restriction is calculated using a finite-element method. During the optimization process, the superconductor null permeability model is used. Finally, the results are checked with the Bean model and verified experimentally. Measurements of the levitation force and the field mapped over the magnetic rails are presented. Significant reduction of soft and hard ferromagnetic materials was reached.