Record sales by Google’s parent fuelled by a surge in digital ad spending, strengthening the giant amid bids to curtail its power.