Saudi Arabia posted a budget surplus of $20.7 billion (SAR 77.9) billion in the second quarter, boosted by a surge in oil prices and production.