It was an honest question. With a Regional train there are frequent stops, so the lights are on so that passengers can safely get on and off the train, and find all their belongings. Airplanes don't have frequent stops, so dimming the lights doesn't have a negative safety effect.
As darben wrote, lights are dimmed in coaches on long-distance trains.
If you want to sleep, surely a $2 eyeshade is the answer.