Google’s efforts to position its core advertising business for the mobile age are helping it to stave off challenges from Facebook and other rivals as fourth-quarter ad clicks grew and the cost-per-click rate fell.