1. From Tokyo to Hakuba.
1) Hokuriku Shinkansen + Bus
Alternatively, take the JR Azusa limited express train from Tokyo's Shinjuku Station to Matsumoto and transfer to a local train on the JR Oito Line to Hakuba.
2. From Hakuba to Osaka
1) JR Oito Line local tran, JR Shinano Limited Express, and Tokaido Shinkansen.
A local train of JR Oito Line from Hakuba to Matsumoto, transfer to JR Shinano limited express train from Matsumoto to Nagoya, transfer to JR Tokaido Shinkansen from Nagoya to Shin-Osaka.
Read this here.