Regional trains in Germany are priced based solely on the distance traveled so you don't need to book early because the price is always the same. You can book still book most regional trains via Omio or TrainLine simply for the convenience of not needing to buy them at the station.