A modified Lagrange–Galerkin method for a fluid-rigid system with discontinuous density