The rail traffic produces progressive deformations of the foundation, which may lead to a loss of stability. While the rail can be modelled with sufficient accuracy by the one-dimensional elastic or elastoplastic beam equation, the behavior of the foundation is more complex and includes irreversible structure changes such as decrease of the void ratio and degradation of the material. We describe the full problem by a partial differential equation coupled with a non-convex variational inequality and prove that it admits a unique solution.