Hitachi Ltd. and Sagawa Express Co. agreed Wednesday to buy stakes in each other's distribution businesses as competition among Japanese logistics companies intensifies.

Hitachi Transport System Ltd. will buy 20 percent of Sagawa Express Co. for ¥66.3 billion ($591 million) from its parent SG Holdings Co., according to a joint statement Wednesday. Closely held SG Holdings will also buy 29 percent of Hitachi Transport for ¥87.6 billion, the statement showed.

Sagawa, Japan's second-largest courier service, and Hitachi Transport may also eventually merge, according to two people familiar with the situation, who asked not to be identified because the information isn't public. Japan Post Holdings Co. and Kintetsu World Express Inc. have been leading a reorganization of the delivery and logistics business in Japan with takeovers last year.

Hitachi Transport has bought stakes in companies to help its expansion domestically and overseas, including Turkey's Mars Logistics Group, Hong Kong's CDS Freight Holding Ltd. in 2013 and Japan's Vantec Corp. in 2011.

SG Holdings has also expanded overseas, opening a delivery service in Vietnam and forming a business alliance with Korea's Hanjin Transportation Co. in 2011 and China Courier Service Corp. in 2006.