Turn both over at once.
When the 4 min glass empties turn it over, let the 7 min timer keep going.
When the 7 min glass empties turn it over.
When the 4 min glass empties again, 8 minutes would have passed and there will have been 1 min of sand passed in the 7 min timer, so turn the 7 min timer back over to get 9 minutes.