CBRE Group Inc. has agreed to buy Johnson Controls Inc.’s global workplace solutions business for $1.48 billion in cash, as the commercial real-estate firm looks to capitalize on the trend of corporations outsourcing real estate services.