No justice of the supreme or superior court shall be an officer in any railroad corporation in this state.