Complete and utter coincidence. It just so happens that Top Gear was filming at the same airfield that the C130s regularly practise at.
Besides, can you imagine how much the BBC would have to cough up to hire two C130s (wargoers too) to deploy overseas for a bit of filming?
I do think, however, that the people behind the cameras made full use of the exercise going on behind them and why not? The BBC gets some particularly exciting footage, the RAF gets some free publicity and it provides a briefly interesting talking point.
Nice one for all concerned methinks.
Edited to add: Besides you can definitely tell its one of our J's because the No1 engine's nacelle bears no similarity to the colour of the rest of the aircraft!