A former German lawmaker and Volkswagen labour leader has been convicted in court after confessing that he used company money for prostitutes and lied to conceal his actions.