Royal Bank of Canada agreed to buy HSBC Holdings' Canadian unit — the country's seventh-largest bank — for C$13.5 billion ($10 billion) in cash, expanding its roster of business clients and bulking up its retail presence on the West Coast as HSBC focuses on Asia.