Forget capsule hotels. There are plenty of inexpensive hotels in the Ueno/Nippori area. Instead on the Keisei Main line, you might want to consider the Keisei Skyliner-Metro combo deal which gives you 2 days of subways passes along with the Skyliner from NRT to Ueno. You can use the Main Line for the return to NRT.
In addition to the suggestions in the post above, check out hotels at Japan Hotel Network or Rakuten Travel for cheap satys near Ueno.