You're right, Mars' moons likely did not form with from the same dust mass as it; their spectra, albedo, and density are suspiciously similar to those of C- or D-type asteroids. Thus, Mars presumably captured Phobos and Deimos from the asteroid belt. However, the origin of the Martian moons is quite controversial.
Burns (1992) notes that capture requires the loss of energy (and momentum, as you pointed out). So obviously, something would need to dissipate that energy. The immediate candidate is aerobraking, but we run into a problem: Mars' atmosphere is too thin to capture a Phobos-sized object through aerobraking. In fact, even if aerobraking could capture Phobos and Deimos, the densities of both moons indicate that they may not survive structurally.
Several hypotheses have been proposed to answer this. Landis (2001) suggests tidal forces are to credit:
The existence of asteroid moons provides a mechanism for the capture of the Martian moons (and the small moons of the outer planets). When a binary asteroid makes a close approach to a planet, tidal forces can strip the moon from the asteroid. Depending on the phasing, the asteroid can then be captured. Clearly, the same process can be used to explain the origin of any of the small moons in the solar system.
According to Geoffrey Landis, Deimos and Phobos could have each been moons of parent asteroids, and they were separated due to tidal forces:

This would explain how Phobos and Deimos could survive as moons. I could mention the other hypotheses, but Landis' would answer your question quite well.
Right now, there isn't any clear consensus as to how Phobos and Deimos became moons. More research is still necessary, and we may need to modify our models for the evolution of Mars and the asteroid belt.