The cars will absolutely know how many occupants they have.
I think owners will be able to opt-in to sharing data with other cars, and they will do it for their own safety. It could be required by the government, too, as driving is not a right and CAN BE INFRINGED.