Lagrangian submanifolds and higher-order mechanical systems