This has been a fairly common question over the years - One that's surprisingly difficult to answer, because the route that you're talking about (Tokyo to Kyoto) is served by a fast train service that only makes a few stops, and the stops it makes are mostly in major urban areas. Any onsen resort that's "on the way" is necessarily somewhat "off the way" ... if you see what I mean.
Maybe I've got the wrong end of the stick, but the request is open-ended, so here's my take... Since you mention JR Rail, I'll assume that you are using a JR pass, which means you're taking a Hikari train to Kyoto. I'll assume you don't want to take a Kodama, which is rather slow. So here's just one of the MANY possibilities ... taking advantage of the fact that some Hikari trains make stops at smaller cities between the large cities.
Take the 4:33 PM HIKARI 521 from Tokyo to Toyohashi (arr. 5:57 PM)
At Toyohashi, take the 6:20 PM Limited Express (WIDE VIEW) INAJI 3 to Yuyaonsen (arr. 7:06 PM)
That gets you to the Hazugasho inn - an inn in a traditional styled building with onsen - in time for dinner (but let them know the arrival time because they'll want to know when you'll be having dinner)
http://www.hazu.co.jp/hazugassho/hotspa/
Next day,
leave Yuyaonsen around midday for a 5pm-ish arrival in Kyoto.
[EDIT: Take the 11:49 INAJI 2 to Toyohashi and at 1:13 PM take the KODAMA 649, which gets you to Kyoto at 2;35 PM]
Whaddaya think? Too far off the path? Any decision is going to be a compromise between a bunch of factors. If you tell us what's important to you, it might be possible to make recommendations.