Pets are globally allowed to travel by train in France and in Italy.
In France a small fee is applied wheater in Italy it’s not needed. SNCF and FS will issue a ticket for your pet.
Pet passport is required but nobody ever checked it. It’s basically needed in case of a passenger would like to make sure your pet is vaccinated and hence not dangerous.