The relay is mounted on the fusebox/body computer unit, above the accelerator pedal... and is unlikely to be 'stuck' - the ticking you hear is the contacts moving.
My old 4x4 did that occasionally: often it would carry on 'ticking' regularly like a clock for a while after the window had closed, as if the switch were stuck, and then wouldn't open again. It tended to fix itself after a few minutes. I think it actually relates to too much friction in the window mechanism. The electronics senses the window has gone fully up or fully down by detecting that the motor is straining to move the glass any more and turns off. But, if the glass is sticking in its guide tracks inside the door, this confuses the system somehow.
Try (with a friend) opening the door and putting one hand on either side of the glass, then, while pushing both hands towards each other, try 'sliding' the glass down while someone else operates the switch...