you could do this using multiple providers in the same program pointing to the two different accounts that you mentioned
for example:
1. create a vpc, networking resources, ec2, load balancer and acm cert using account A provider
2. create records for cert validation using Account B provider
3. add dns record for load balancer using Account B provider