The paper deals with numerical analysis of the process of roller straightening of rails. The problem of repeated elasto-plastic bending is solved by a program in MATLAB based on FEM algorithm with Eulerian description of material flow through the straightening machine. Beam element formulation with a shear deformation effect is used for the rail discretization. The results are compared with literature and standard FE analysis with Lagrangian description of material flow. Effectiveness of presented formulation is discussed and its applicability for fast iterative optimization of the straightening process is illustrated.