If equal masses of sand and water are heated to same temperature then water will absorb more energy...It is beacuse the specific heat energy of water is more than that of sand thus water requires more amount of heat ko reach a certain temperature than that of sand and thus absorbs more energy
The sand will absorb more energy. This is because it is a solid, and more of a conductor of heat. Water on the other hand is not a conducter of heat, You can observe that even more when the temperatures are equal.
Hope this helps :)