The first time I took the Centovalli Railway, it was a fluke. I was traveling through Europe, and accidentally boarded the wrong train. To my pleasant surprise, I found myself on one of the most beautiful railroads on the continent, a little-known line linking the remote valleys and villages of southern Switzerland and northern Italy . From inside the compact cream-and-blue carriages, I glimpsed bridal-veil waterfalls, cable cars, and stone bridges arching over deep chasms. By the end of the two-hour detour, I vowed I would return for a more leisurely visit. A year later I was back. And as a lifelong train buff, I was determined to take my time. With about 15 departures a day between the Italian town of Domodossola and the Swiss city of Locarno , it’s possible to use the Centovalli as a hop-on, hop-off service at any of the 33 stops along the way. My plan was to disembark whenever the spirit moved me, stay overnight in nearby hotels, and follow well-marked trails into chestnut groves and beech forests.…