I have this problem too. Assuming both windows will slide up and down to the full extent of the window frame independently, and that they are not too tall, you can do it.
First, slide both windows up to the top. Sit facing inwards on the window ledge, slide the outer window down in front of you until you can reach all of it, and clean it.
Second, slide the outer window up to the top. Slide the inner window down until it restes on your legs, and clean as much of it as is possible. This will leave an uncleaned strip across the upper portion of the window.
Third, get back inside the room. Lower the outer window to the bottom, and the inner window about half way down. Stand on a stool, steps, or windowsill and clean the remaining area of the inner window by reaching down.
If, however, you cannot slide the outer window lower than the inner window, you may still be able to clean the upper strip of the inner window if there is sufficient gap between the glass pane of the inner window and the bottom of the frame of the outer window: While still sitting facing inwards on the ledge, use a car wiper blade (or one of those wiper-blade type tools that professional window cleaners use).