Yes, but that’s an on/off switch. Trains and buses allow for a gradual shutdown by scaling down on number of rides per hour or on train/bus size.
That’s a big advantage because, if people can’t get home from a party at 3AM, they may choose to use their car to get at the party, and, having invested in a car, and getting used to using it, may stop using public transport.
That, in turn, can lead to further decrease in service, which leads to fewer people using public transport, etc.