A man who exposed himself on the Kilkenny to Waterford train was handed down a suspended sentence at Kilkenny District Court.