Plans to move for learning japanese and work on railway after

Hi! I plan to move to Japan from Poland for learning Japanese and after work at railway. The plans are for 4-5 years later, so i know something can change. The level of my japanese will be around N4-N2 (the last is questionable). I'm planning to move to region around Kyoto or Osaka. The question is what must i have for documents and visa, and how much it will cost around or how much i should have to start living there and what "surprises" can waiting me there?

Thanks

by Latia_9