In Germany, we have standardized passenger rights in the railway industry. These rights are universally valid, regardless of whether you are traveling on the ICE or the S-Bahn. They are also used in "travel chains", for example when trains of different railway companies are used with one ticket.
Each ticket acts as an independent transportation contract, which is why compensation for delays is determined for each individual ticket. The same applies to return trips, even if they are shown on one ticket.