In the US, Amtrak now allows some pets (cats and dogs up to 20 pounds) to travel on some routes. Additional restrictions may apply, and you should contact Amtrak for details. In Europe, however, animals are often allowed to travel by train with their owners. You should check with the individual country to determine their regulations and restrictions. In some cases dogs are allowed to travel on leash, while in others they must travel by carrier. For other animals, appropriate carriers or cages are generally required.
As with air travel, it is important to make sure your pet has appropriate identification, and that you travel with copies of medical records (including vaccination history) and a health certificate, if required.