If the group in cargo is a seperate group you are right, they will not get out. If they are part of the same group as the vehicle then in general they will get out to fight. At least that is my experience.
You can do this with triggers and waypoints, or with a script. It isn't trivial (although not difficult either) and would take a while to explain. If you have, (or can bear to download) my Un-Impossible Mission there is an example of exactly what you want. If you have the mission I'd be happy to point out the details. I believe THobson has also done this in his Abandonded Armies, currently in testing on the beta board, and I'm sure he will be happy to explain what's he has done. In either case it will make more sense if you have the mission editor in front of you. I'm sure it's been done in other missions too.