Lagrangian Neural Networks for Reversible Dissipative Evolution