Marriott International Inc. has agreed to buy Starwood Hotels & Resorts Worldwide Inc. for $12.2 billion in cash and stock in a transaction that would create the world’s largest hotel chain.