Welcome to the forums and to Trainz.
Unfortunately there is no way to do this directly, and this is content-creator specific and depends upon the model, and or whether the ability to move the sun visor is animated.
There is a workaround which can be implemented, however, we cannot help you until you register your Trainz version since the method is different in Trainz versions prior to T:ANE.
If you have not registered your software, please do so. Once registered, your Trainz version will appear on the station line next to your user name.
If you already registered, or are a previously registered user of a Trainz version and forgot your previous username, contact the Helpdesk via the link at the top of the forums.