Many trains in Israel travel long distances.
I would like to know if there are restrooms on board all trains.
Trains in Israel are hardly long distance. The longest is an hour and a half, two at a stretch. And yes, they have restrooms, but you can always go out at a station, and take the next train, if there's a real problem:-)
Your ticket is valid for a travel, once you pass the gate at the entrance of the origin station, till you exit at the gate of your destination station (where you surrender the ticket). In between you're free to step in and out the trains as you wish, as long as you don't exit the interim stations. Public restrooms are generally clean.
All trains have restrooms. Trains go from Naharia (north) to Beer Sheva (South)- which leaves the south of the country for bus use. Almost no relevant trains for tourists in west-east direction, exept Jerusalem (which has nice view but take twice as long as a bus ride).