Cargobike versus pedelec with trailer
If you choose between a pedelec to pull a trailer and a cargo bike? To be clear: I wouldn't compare a trailer you can buy on ebay for 500 € and a cargo bike easily ten times as expensive and currently no considerable second hand market (because they are recent and trendy). Both are great to have, but we'd be comparing apples with pears. So we're comparing a child trailer pulled by a pedelec to a cargo bike which is more expensive but can also pull a trailer. If your municipality offers a fee bate of 1.000 € for buying a cargo bike, this more or less covers the price difference between a pedelec and an electric cargo bike. Otherwise: get them going ;)
If you want to fit two kids onto your pedelec, you'll need a wide trailer or an extra seat on your bike. In wide trailers, the kids might be bothering each other without you being able to see who's doing what, and the street infrastructure may be difficult to navigate. My experience with child seats was okay, but for a front seat you need the right frame geometry and in the back your child has a pretty shitty perspective and getting the kids in and out of the low trailer is more cumbersome than lifting them into a cargo bike. The perspective from a trailer is probably also less exciting than the one from the front of a cargo bike (our kid always choses the front when it can). On the other hand, your kids are well protected from cold and rain in a trailer, for which some cargo bikes need an extra roof and new pedelecs come with torques of 60 - 75 Nm (and batteries with 500 Wh), which is great when you have serious slopes to handle.
When it comes to shopping, my wife said she was happy to have the trailer on top of the cargo bike because all her stuff wouldn't fit into our e-Muli and she doesn't want to have to bother about perfectly packing the rack panniers when the next client is waiting in the supermarket line. With the trailer, she can just through everything in there. My shopping usually consists of a box of beer or two, which I either put in the cargo bike or in the trailer.
On the weekends, we sometimes go cycling with friends who have kids of different ages. So one can cycle a certain range but gets tired at some point. With a cargo bike plus trailer, you have enough spare capacity to take an extra kid, a balance bike or a bbq aboard. If you want to take your bike on vacation or on a multimodal trip: cargo bikes with fix superstructures cannot be taken onto trains in Germany.
Finally, I hope for a good resale dead if I ever want to get rid of my cargo bike because the offer isn't great yet and I'm still among the first movers.
To resume: affording a cargo bike is a bit more expensive, and an extra trailer will indeed require some more investment than the combination pedelec (2.500 - 3.500€) plus trailer (500-1.000€). Cargobikes with fixed superstructures cannot be easily transported with other (street and rail) vehicles but offer better protection against cold and rain. A cargo bike with a foldable pannier and removable roof (5.000€) and a trailer offer all benefits but also come at a higher price. More importantly, you should reflect what other vehicles you (want to) have and use, age and number of kids, topography and climate and physical condition of riders.