As they look to contain an increasingly aggressive China, the United States and Japan announced dozens of new agreements, including on military, economic, climate and space matters.