Part of the problem is that the Agent Manager is going to use a different ClassLoader than the XPages servlet itself. So a lot of the no-effort capabilities provided by XPages aren't yet available in Agents. In this particular case, to get the same behavior, you would need to import the entire NotesFileSystem plugin to your agent. This could prove... daunting.
However, a much simpler solution would be to use DXL from the Agent content. You can build a NoteCollection that includes your XPage resource fairly easily, and when you export it via DXL to a stream, you'll have an XML block containing the base64-encoded XSP source as a file attachment. I believe it's in the $FileData item. Extract this content, base64-decode it, and you should have your original XSP markup.
Otherwise, if you want to go with the ResourceAsStream route, you're going to have to do a lot of reverse engineering on the plugin JARs that make up the XPages runtime so you can include them in your Agent. It will take a while.
You might also want to try the XAgent approach, as documented by Stephan Wissel. Google is your friend to find that one.