Change Partition size on internal AFPS drive
Ok, so it turns out this error -5344: MediaKit reports not enough space on device for requested operation is caused by the fact that you are trying to expand a container backward into free space that exists before it on the partition list, even though Disk Utility (and by extension diskutil) can only expand partitions forward into free space that comes after the container in the partition list. Another notable error is your attempt to resize the Physical Store partitions on which the Container disks are stored (disk0s2 and disk0s4), rather than the Container disks themselves (disk3, disk4, and disk5 in the below example). 

With a bit of trial and error I was able to figure out how to effectively merge Containers 2 and 3 into one, with no data loss to Container 1. Note that this will require the deleting of the Mojave beta partition, so make sure you either have it backed up, or have an installer on hand. 

UPDATE: There is a way to do this without having to reinstall the second OS. In macOS versions up to Sierra (I haven't tried it in newer) you could create directly bootable backups of your entire system with (adjusting for the disk names you gave in your question) sudo ditto -V -X --nocache /Volumes/Mojave\ beta/ /Volumes/Untitled/ NOTE: for backing up the currently booted system, subsitute /Volumes/Mojave\ beta/ with /

For posterity please make sure you have a macOS installer (USB or Recovery HD) on hand for each OS you have installed. 

Please also remember that these disk lables are just the ones for my disk on my system, always double check the names are correct for yours when running these commands by comparing them with the output of diskutil apfs list 

In order to replicate your situation the best I could, using Disk Utility I formatted a 4 GB flash drive as APFS. I then partitioned the disk two separate times, which resulted in three APFS Containers, and three virtual volumes, in the following order:


  First Container
  Container disk3  -  1.85G
  Physical Store disk2s2
  Volume disk3s1  
  
  Second Container
  Container disk4  -  0.94G
  Physical Store disk2s3
  Volume disk4s1  
  
  Third Container
  Container disk5  -  0.94G
  Physical Store disk2s4
  Volume disk5s1


I then opened a terminal, and deleted the Third Container with: diskutil apfs deleteContainer disk5, which resulted in disk2s4 being converted into an HFS+ volume.  

After this I deleted the partition disk2s4, and in so doing freed up the space necessary to expand the Second Container by running diskutil eraseVolume "Free Space" "" disk2s4  

At this point the partition list looked like this:  


  First Container
  Container disk3  -  1.85G
  Physical Store disk2s2
  Volume disk3s1  
  
  Second Container
  Container disk4  -  0.94G
  Physical Store disk2s3
  Volume disk4s1  
  
  Free Space  -  0.94G  


Finally I was able to expand the Second Container to 1.85 GB with diskutil apfs resizeContainer disk4 1.85G. The final result of this is two APFS Container disks of equal value on the flash drive:  


  First Container
  Container disk3  -  1.85G
  Physical Store disk2s2
  Volume disk3s1  
  
  Second Container
  Container disk4  -  1.85G
  Physical Store disk2s3
  Volume disk4s1  


Besides adjusting the commands so that the disk labels match those on your own machine, the one notable substitution you should make is changing 1.85G to 100G in the final command. Beyond that this should be all you need to make the conversion requested.