“We deeply apologize for our failure,” Japan’s space agency chief said after its first failed launch in almost 20 years.