I would agree that this question is more of a logic puzzle and less of a real test of 'theory of mind'
In fact, just to have a theory of mind, it kind of assumes you have a mind, with your own ideas/motivations/etc
It would be like testing if a society could build a rocket ship when they don't know how to use tools.
Our ability to understand animal intelligence is limited by or ability to ask appropriate questions, so we tend to underestimate intelligence outside of the primate space.
Here's an excellent book on this topic: https://www.goodreads.com/book/show/30231743-are-we-smart-en...
I don't have a link but I believe squirrels do, for the exact same reason: their lives are full of intense intra-species competition, with other squirrels constantly raiding each others' stashes. IIRC squirrels will even deceptively hide acorns if they know another squirrel is watching.