Hello there,
The 21 day JR Pass would be the best choice, given the amount of days you will spend in Japan and all the routes traveled.
Here is a quick breakdown of ticket prices.
Tokyo - Osaka ¥ 14,140
Osaka - Kyoto ¥ 560
Kyoto - Hiroshima ¥ ¥ 11,090
Hiroshima - Nagasaki ¥ 12,990
Nagasaki - Hakuba ¥ 24,500
Hakuba - Tokyo ¥ 10,000
For a total of ¥ 73,280 or ¥ 13,930 in savings as the 21 day JR Pass is ¥ 59,350. The JR Pass will most certainly give you more value as it can also be used for local travel within Osaka/Tokyo, to and from the Airport and in many other instances. It also serves as one ticket for all the above rail travel.
Hope this helps,
Daniel