Generally it cannot be done, but you can however work around this and create something which simulates it.
First of all, ditch the replaceobject approach, its' rubbish, try this instead...
Code:
Behavior = CreateObjectDie ModuleTag_99
DeathTypes = EXTRA_2
CreationList = [an OCL that creats the new unit]
TransferPreviousHealth = Yes
End
What this simply does is, if the unit is killed by a weapon with that deathtype, it will create the OCL with the new object(s) retaining the last known energy of the unit before it was killed.
All you need to do then is create a suicide button like the bombtruck, with which the suicide weapon has the EXTRA_2 deathtype (make sure no other weapon has this deathtype), make sure that there are no sounds or effects for dying by the EXTRA_2 deathtype aswell.
When you click the button, the unit 'dies' and is replaced with the OCL object with the same energy (incdently, make sure the OCL is created on the exact same spot).
Now how does this fix your problem? simple, make the occupants of the original vehicle survive if the transport is destroyed, so when you 'kill' your unit by this weapon it will be replaced and the infantry will come out, no upgrades involved.
btw, check out the pilot OCL for how to transfer veterancy aswell, oh and make sure that both the original unit and the new one have the same max energy.