More than 10 pct of the search engine’s revenue now comes from mobile. Google and Facebook show how heavy investments can pay off over time. Yet the cost is high and margins get squeezed. In China, competitive lines are more blurred. Returns may be even longer in coming.