Some one who has an idea of variation would solve this without a problem...
Silver has density = 10.5g/cm³ and a volume of 5cm³
Gold has a density = 19.3g/cm³ and volume of 5cm³
If you observe the volumes are the same...
Density = mass/volume
Mass = density × volume
Since the volume is constant, the material with the greater density will have the greater mass and that's gold....
You might want to test
For gold mass = 19.3×5 = 96.5g
For silver mass = 10. 5 ×5 = 52.5g
96.5g>52.5g so gold has a higher mass....