Were there restrictions to civilians on traveling on these trains? Could one commute or travel for personal reasons using the trains?
It depends on how far away the front is.
In the context of the Second World War, all trains and railroad infrastructure at all times are considered military targets. There is no such thing as a non-military train or railroad. If it can transport troops and munitions, or even workers for factories it's fair game for the opposing air forces and other forms of attack.
That being said, a train travelling within fighter and tactical bomber range of the front line is quite likely to be strafed or bombed at low altitude. A train travelling outside of the range of these aircraft is much safer. Strategic bombers are more likely to target railway yards or large infrastructure elements than individual trains, since they lacked the technology to hit trains from high altitude. Sometimes allied long range escort fighters dropped down to conduct strafing attacks on trains as well, but these didn't appear over Germany until 1944.