There are random checks on both buses and trains. I've had my passport checked when traveling by train from Germany to France and when traveling by bus from Austria to Germany. I also had my passport checked almost every time when traveling to Switzerland, but the last time I went there was 8 years ago.