Which is unfortunate given that it is vastly more expensive than both. Another shit-headed, misbegotten euro-project.
Apple and oranges...
Both C130 and C17 are old planes, their developpement costs have been repaid.
Furthermore, try to land a C17 on the kind of very rugged terrain the Hercs and A400M can handle, hilarity will ensue. Sure, it can handle short and unpaved runways, but not the random pasture the other can use.
Comparision between the A400M and the C130 are more accurate, but if you look closely at the characteristics...
The price is 150M for the A400M, 100M$ for the C130J, but the A400M can carry up to 37t (20t for the C130J). As you need a single A400M instead of two C130J, this seems a far better deal. The A400M is also a bit faster with a similar range...
So no, it is not that clear cut as you seems to think.