I had a similar problem. You need to reset the computer.
Disconnect the battery and THEN turn the headlights lights on (trust me). Leave it like this for at least half an hour for the electronics to drain of any current.
Turn the lights off and reconnect the battery. the rear window will then reference itself by going to the down position.
In my case and for some inexplicable reason I had to leave it 4 hours to drain the electronics but this is not usual.
Let me know how you get on. If this doesn't work it could be something to do with your rear wiper, maybe the micro switches.