The window and document objects are just provided by web-browsers and are not part of the ECMAScript standard which Rhino implements. They are there to allow a script to access the current browser window and the HTML document. The document object is actually an implementation of the W3C DOM.
Rhino is a pure implementation of ECMAScript/JavaScript 1.7 and therefore does not know anything about HTML pages, windows and browserstuff in general. It is a general purpose scripting language which just happens to be mostly embedded into a web browser and thus you can usually use the global objects provided by the browser.
You can of course define some globally accessible objects with the names "window" and "document" which are just stubs which do nothing, but the script you want to execute probably uses some methods and/or properties on them, so this won't help you much. If you want to execute a script, which was written for execution in a browser environment, you need to provide a full "browser"-like environment.
If that is possible and makes sense in a server context is another question...