The rock will come back to room temperature faster than the water.
The rate at which an object gains or loses heat is determined by its specific heat capacity. Specific heat capacity is the amount of heat energy required to raise the temperature of a unit mass of a substance by 1 degree Celsius. Water has a higher specific heat capacity compared to most common rocks.
In your scenario, if you heat up a 1-kilogram rock and 1 kilogram of water and then allow them to cool down in the same environment, the water will cool down more slowly than the rock. This is because water has a higher specific heat capacity, meaning it can absorb and retain more heat energy for a given mass compared to the rock. Consequently, it will take more time for the water to release that stored heat energy and cool down to room temperature.