We consider mechanical systems where the dynamics are partially constrained to prescribed trajectories. An example for such a system is a building crane with a load and the requirement that the load moves on a certain path.Enforcing this condition directly in form of a servo constraint leads to differentialalgebraic equations (DAEs) of arbitrarily high index. Typically, the model equations are of index 5, which already poses high regularity conditions. If we relax the servo constraints and consider the system from an optimal control point of view, the strong regularity conditions vanish, and the solution can be obtained by standard techniques.By means of the well-known n-car example and an overhead crane, the theoretical and expected numerical difficulties of the direct DAE and the alternative modeling approach are illustrated. We show how the formulation of the problem in an optimal control context works and address the solvability of the optimal control system. We discuss that the problematic DAE behavior is still inherent in the optimal control system and show how its evidences depend on the regularization parameters of the optimization.