Density is defined as mass per unit of volume, which means that, for two substances that occupy the same volume, the more dense substance will weigh more.
In your case, silver has a density of
This means that, for equal volumes, the gold block will always weigh more than the silver block. The exact weighs of the two blocks will be
The gold block is heavier both because individual gold atoms are heavier than silver atoms, but also because they pack better - and that's what density actually measures, how many atoms you can pack per unit of volume.