No dear foreign guest, it is NOT unwise to travel in passenger trains in India. All you have to do is to be careful. Despite what has been written, I do NOT agree having seen all kinds of foreign tourists travelling in passenger trains. In fact, you may surprised if you are given additional space. But do take the warnings seriously; keep your bags/equipments safe, and take your own drinking water with you. For more detailed information, I would recommend you to visit www.indiamike.com which has lots more info on travelling in trains on India.
This is a little more specific website for particular queries, and not for general issues you are concerned about.
I...
more... am no way denigrating this site but pointing to you to another site which has more detailed information on your question(s).
India is NOT so bad as it is made out to be !
I must add that I have been robbed/pickpocketed in Europe/UK in trains and believe it or not at the airports. But that does not detract from the fact that generally people are nice, courteous and helpful. You will be surprised.
Good luck and good wishes.