I literally have been fighting this same thing in my 93 wagon and i have an extra light failure sensor, it doesn't like the LED i put in my third brake light, but if i can bypass the yellow box and no more issues, i might also go this route, also charlie nailed it, on my 91 i had both those issues he stated and had to throughly clean both sides light, and their gaskets and reseal, no more issues!!!
I also punched a hole in the bottom where the water was collecting so no more collecting even if it fails to guide the water out again, it will drain no matter what, and nowy trunk smells way better and no more water in it! Solid peeps here on Toyota nation, i can assure this!