Closed bearing units for railway rolling stock shall operate over 800,000 km or during 8 years of operating life (and, in the near future, 1 million km and 10 years) without any maintenance. In order to achieve such high operational indicators, it is necessary, already at the design stage of closed bearing units, to ensure almost absence of wear during the entire specified operating life. This paper reports the results of the optimal design of the elements in the internal geometry of closed bearings based on refined mathematical models using an example of the cylindrical axlebox bearing unit DUPLEX for 1520 gauge rolling stock. The chosen principal mathematical model was a geometrically nonlinear contact problem from the theory of elasticity, which was solved using a finite element method. An original non-linear finite-element model of the multi-contact problem has been developed, taking into consideration the contact deformations rail‒wheel, the deformation of a wheel-set axis, the deformation of the axlebox and bearing rings during contact with all rollers. The model makes it possible to clarify the distribution of loads in the circumferential direction and, accordingly, the maximum load on a roller. The same model could be used, among other things, to analyze the wear of a wheel flange and the effect of gap difference on the bearing wear. A mathematical model and an objective function have been constructed to optimize the profile of a roller (crown, the generatrix of the lateral surface of rotation) considering the accumulation of damage as a result of the irregular loading the roller surface points due to contacts with both the outer and inner rings. The shapes of the roller's face and the ring's operating flange have been optimized that are in contact in the axial direction, which has helped establish that the anthropologically shaped convex face of the roller and the concave flange of the ring are optimal. To simplify the structure technologically, a variant with a conical surface of the flange with the optimal camber value has been accepted instead of the concave flange of the ring