Purpose. The scientific work is intended to develop a methodology for describing the structure of the railway vehicles (they are considered as a system of rigid bodies connected by rigid, elastic and dissipative elements), which would allow us to obtain the equations of motion in an easily algorithmized way. Methodology. When constructing the model, authors tend to ensure that its structure reflects the structure of the mechanical system, that is, parts of the model must correspond to parts of the car. In this case, the model takes the form of a hierarchically organized graph whose vertices correspond to the bodies, attachment points of the connecting elements and to the connecting elements themselves, and the edges describe the sets of processes that are related to the incident vertexes. As a rule, these are movements and forces: for the edge between the body and the attachment point they are generalized movements of the body and the general forces acting on it; for the edge between the attachment point and the connecting element - the movements of the point and the forces arising in the element. To each vertex there corresponds a group of equations describing the motion of the system. The nature of the equations depends on the type of the vertex. For the body it is the equations of body motion; for the point - the expressions for the point displacements through generalized displacements of the body and generalized forces acting on the body, through the forces arising in the connecting element; for the connecting element - the expression for the forces arising in it through the deformation of the element. The graph can be regarded as oriented. The direction of the edge is chosen in such a way that for each vertex the values on the right-hand side of the vertex-associated equation would correspond to the incoming edge, and in the left-hand side - to the outgoing edge. Findings. A technique for constructing a dynamic model of oscillations of railway vehicles as a system of rigid bodies is developed on the basis of their description using hierarchically organized graphs. The technique was tested to construct a model of spatial oscillations of a 4-axle freight car with an axial load of 25 tons in Simulink package. Originality. For the first time, a technique has been developed for describing the structure of a railway vehicle using a hierarchical graph, which makes it possible to obtain equations of motion in an easily algorithmized manner. Practical value. The proposed methodological approach will allow, after creating a library of bodies and connecting elements, to significantly reduce the time spent on modeling the oscillations of different vehicles.