There are folding tandems that might work. Bike Friday sell
one that packs down so you can fit it in a car trunk, the electric option is a front hub motor. Dutch brand Azor also sell a
folding tandem that can fit on a regular bike rack and could be converted with a front hub motor wheel if you ordered one with rim brakes.
Worksman also sell a folding tandem but it gets mixed reviews and I’m unsure it would be a candidate for conversion without also swapping out the fork for one with disk brake mountings because it comes with a front drum brake you would lose by fitting a front hub motor wheel. But tandems require active pedaling from the stoker or it throws off the handling/balance.
If she does not want to or cannot pedal, an alternative to a cargo bike might be an
adult trailer you could tow with a standard ebike, and would fold down to carry in a car trunk with the bike on your ebike rack