Provably Safe Control of Lagrangian Systems in Obstacle-Scattered Environments