Sleeper cars are harder, since it is the journey time that counts, which is not measured anywhere in Simutrans. One could, of course, use the suggested catering system and produce graphics of a sleeper car, and call it a sleeper car and be done with it (since sleeper cars always have catering in any case). One could also set a "catering level", to distinguish between a trolley service, a mini-buffet, cooked meals at seats, and a full Pullman-type service: perhaps, 0 for no catering up to 4 for the highest level of catering, each attracting different levels of revenue enhancement, but each requiring the journey to be longer to have effect? Catering could also work for road vehicles, ships and aircraft in the same way.
Edit: One problem with catering cars, however, is that the revenue increase depends on the length of the journey, which, in turn, depends on the speed: an at-table meal service might have been profitable on a 100 mile railway trip in 1920, therefore, but nothing more than a trolley service justified on the same trip in 1990. What might work is this: instead of defining a length in number of tiles required before the catering bonus takes effect, define a notional journey time, taken by dividing the number of tiles (representing kilometres) with the speed bonus speed (in kilometres per hour). There could then be defined in simuconf.tab some standard catering bonus levels (level 1, 1 hour; level 2, 2 hours; level 3, 3 hours; level 4, 4 hours, for example). Any journey above the length at which it would take that time at the speed bonus speed attracts the lowest of: (1) the highest catering level of any vehicle in the convoy; and (2) the maximum catering level of the journey length. The maximum level could be smoothly phased, such that, for example, with a catering level of 2 or higher, a notional journey time of between 1 and 2 hours would attract the level 1 bonus, plus a proportion of the difference between the level 1 and level 2 bonus.