Toyota Motor Corp. is investing about $500 million in Uber Technologies Inc. as part of an agreement by the companies to work jointly on autonomous vehicles aimed at improving safety and lowering transportation costs.

Toyota’s investment values Uber at about $72 billion, slightly higher than where SoftBank Group Corp. valued the ride-hailing company earlier this year with its funding, according to people familiar with the matter.

Under...