An instance where we do know the numbers: 9/11 attacks cost the attackers $500,000 according to intelligence estimates. The government response so far has cost $2 trillion (wars, etc.). That's a 4 million to 1 ratio.
I think a better measure would be total funds that wouldn't have been spent otherwise (had 9/11 not occurred), as a measure. So for the US the costs to cleanup/rebuild Ground Zero and the Pentagon + the cost of deploying to Iraq and Afghanistan and whatever we're spending on Syria now plus whatever other operations happened as a result. For AQ it would be the cost of the attacks plus costs of expanding into Iraq and whatever involvement they had in Afghanistan.
This is to say nothing of the human costs in all this which we can all agree are the real tragedy.