In every part of Thailand I've been to outside BKK, there's a gas station almost every few kilometers on every major road. Almost every gas station has a public restroom that's open 24/7, unattended. The ones that don't have a public restroom are typically right next to a string of restaurants that have a restroom you can use during the day for free if you ask.