Rail passes are limited to tourists (having any other kind of visa will disqualify you) and last up to three weeks, if I remember correctly.
I have never used a rail pass because I've mostly been ineligible, but from what I've heard, it's not worth it. You'd have to be traveling almost constantly, using multiple limited express lines per day, etc. to recoup the cost.
As KW said above you will want to get a Suica/Pasmo/Icoca card (they function identically and all work on every line across the country) or the equivalent version on your mobile app. I had trouble getting the mobile app to work so I had to buy a physical IC card, which I find more convenient anyway, as you can simply tap your wallet on the scanner.
Also as KW said there has been an IC card shortage for like 18 months now, but don't worry, tourists can get a limited-time "Welcome Suica" card at the airport which has never run out of production as far as I'm aware.