I feel like none of the answers have addressed you train example correctly. The momentum is exchanged with the Earth. So the Earth+train still have the same total momentum. The energy is mostly conserved (ignoring the friction that's needed to stay on the track). You can do the same by running past a lamp post and extending a hand to grab it - you'll change direction.