I noticed something strange. An enemy hero fled into a Dungeon containing a Mage Guild. A few turns later, Railagh descended there and couldn't find him. I didn't see the hero's level, but theoretically, he could have teleported to a town. But after a few more turns, he emerged from there. There doesn't seem to be anywhere to hide in there.
Finally, I found the third Castle. I didn't think it would be located away from the main roads.
The mystery has been solved. It turns out that there is an underground passage from the Mage Guild to the Castle, which I didn't notice during my first descent.