A Stuttgart court has ruled in Porsche's favour in a dispute with the Volkswagen works council.