Simply put, money is given to MoD to achieve the stated goals - and it is up to the MoD how to spend it to achieve the agreed goals - so savings in the RN may end up spent on the Army or the RAF, and will do before the money heads back to the Treasury. (And before you tell me that I'm ignorant of the facts, I'm virtually certain that I've been closer to the process at HM Treasury than you have.) With apologies for the length, here are my thoughts.
I am more than virtually certain that you have been closer to HM Treasury than me.
However, are you rilly, rilly, rilly, certain and not merely virtually sure that money not spent on aircraft carriers will not be reallocated to more pressing British needs, such as more housing and health care benefits for additional, newly arrived Muslim immigrants?