As a test, I created a 100 MB APFS disk image and saved it to the default location, in my Documents folder. I then unmounted the disk image, as it needed to be unmounted to test what I did next.
Next, in Automator, I created a new Folder Action, while setting Folder Action receives files and folders to
Volumes. I did this by clicking Choose folder > Other… and then pressed ⇧⌘G to bring up the Go to the folder: sheet. I then typed in
/Volumes and clicked the Go button, followed by the Choose button.
Next I added an Open Finder Items action and saved the Folder Action as e.g. Open Mounted Disk
From Finder, I then doubled-clicked the APSF.dmg file and when it was mounted, it opened a new Finder window to the root of the mounted disk image.