I played with this a little with a test .dmg file similar to yours. There may be a problem with Disk Utility's Resize function, but you can work around it.
Resizing the .dmg image file and resizing its contained partition are separate procedures. You can see them both if you click on the little triangle in Disk Utility's Resize window:
.

.
After doing this, you see the following. The button to resize both the image and the partition is selected by default, which is what you want:
.
.
However after clicking the Resize button, my result was the same as yours - only the .dmg file was resized, not the contained partition.
To try to fix this, I did the following. Mount the image by double-clicking the .dmg file, select the .dmg file (upper icon) in the left pane of disk utility, and click the Partition tab. I was then able to pull down the lower-right corner of the partition graphic to fill the entire space.
.

This increased the size of the partition to the same size as the image file. I then clicked Apply.
When I later checked the mounted partition in Get Info, it reported the new larger size of 5GB.