The mAh rating of a battery tells you roughly the energy storage capacity of the battery as a function of the terminal voltage. In direct answer to the question "is it important?" Yes. For a given terminal voltage, a battery with a higher mAh rating will last longer as it stores more energy.
However, you cannot directly compare the mAh rating of two batteries which have two different rated voltages. Your NiMH batteries have a rated terminal voltage of 1.2V, whereas the LiIon have a terminal voltage of 3.7V.
If you convert the Ah rating to an actual energy value in Wh you get:
- NiHM = 3 Wh
- Li-Ion = 5.5 Wh
What that is telling you is that the Li-Ion batteries, despite the lower mAh rating, actually have a much higher energy density - they store almost 2x as much energy.
If you have 2 Li-Ion batteries in your system that would give you 11Wh of energy. If you have 3 NiMH batteries, that would give you 9Wh of energy. So despite the lower mAh rating, the 2 Li-Ion batteries still store more energy than the 3 NiMH ones.