Rats are social animals and much smarter than most of rodents (including squirrels). Trust me, my mother was behavioral biologist, and she experimented with both rats (black rats, Rattus rattus) and red (European) squirrels (Sciurus vulgaris).
Maybe, it is wrong tests, there are some discussion in this field how we (humans) should asset animal intelligence.