TOKYO — Two weeks ago, SoftBank Group of Japan announced that it had lost billions on soured investments in some of the world’s biggest tech start-ups. On Monday, it said it was ready to roll the dice again.

The company announced an agreement to merge its Yahoo Japan subsidiary with Line, a dominant messaging app company, to create a Japanese internet goliath that would be able to compete against bigger and better-financed tech firms in the United States and China.

The combination would bring together two prominent Japanese companies that have seen better days. Yahoo Japan, formed in 1996 as a joint venture with Yahoo, offers a range of services including online shopping and news but has struggled to make the move from desktops to mobile phones.

Line’s chat app has 82 million users in Japan but has struggled to expand its user base. The company fell into the red last year and has continued to book losses.