I remember the princess being kidnapped by an evil witch or queen who didn't like to smile. The boy and conductor went on a journey on the conductor's train to find out where she is and rescue her. Eventually they find her, I think and they managed to convince the evil queen or witch that smiling was good and she laughs.
This sounds extremely close the german classic book Jim Button and Luke the Engine driver which was adapted into a cartoon series in 1998 (pictures here). It is about the boy Jim Button who grows up on a small island without knowing his real parents with the engine driver Luke being his best friend. They embark from their island on board of their train engine (turned into a boat by emptying the tank) to relieve concerns of overpopulation and come across a china-inspired country called Mandala where Princess Li Si was kidnapped by a (very witch-like) Dragon named Ms. Grindtooth who intends to use children to learn to laugh from them. In the end they do manage to defeat her which triggers a transformation into a "Golden Dragon of Wisdom" making her benevolent.