I think you're on the right track to not use a solid driven axle, as it will give you problems as you describe.
I don't believe that a single wheel drive would be too much of a problem, unless you're on slippery surfaces like ice or mud, but you do have to deal with the counter torque. For hub motors, there's usually a means to secure the hub assembly, often a torque arm. Such a mechanism might be challenging to implement, depending on the layout of your cart (photo recommended).
A fifth wheel may be the easiest to implement and the one design that comes to mind is something that already exists, called SmartDrive Wheelchair Power Assist. The linked video shows a pivoting "power pod" that provides a push, but also rotates about the attachment axis.
This allows the power unit to maintain contact when contact angles for the wheels change. I suspect also that there is a vertical axis pivot to deal with the turns, but it's not obvious in the little bit of video I've seen.
I'm not suggesting that this is the answer to your project, but the concept is sound enough that you may be able to adapt it to your wagon in a reasonable manner.
"E-bike motor" is ambiguous enough to suggest that you edit your post and add the type of motor. Hub motors are one design, both geared and direct drive and mid-drive motors are another. The weights you've referenced would indicate that you'd want a rather low gearing for your motor, as hub motors are very inefficient at slow speeds (generating heat, wasting battery) while mid-drive systems use the gearing of the bicycle on which they are installed.
If you have the space available, building a geared system, even a three speed internal hub powered by the motor with a chain drive would provide you with better flexibility. Internal hubs for bicycles vary from three speeds to fourteen, increasing your options. One could also use the NuVinci continuously variable gearing hub drive, although they don't recommend power assist for that system.
Now that there's a photo and the clarification of a mid drive motor, the fifth wheel approach leaves you with much more flexibility for your mount. The motor can be mounted above the driving wheel and the yoke holding the axle of the driving wheel can have the horizontal pin/hinge at the end of the cart, while the vertical pin/hinge can be at the wheel yoke split. The former gives you the floating aspect necessary to handle variations in terrain. The latter provides for steering rotation without imparting any contra-steering forces (generally speaking).
One expects you can either drill and bolt brackets or weld to the wagon, otherwise you wouldn't be approaching this project on this type of wagon.