BERLIN — A German court handed Elon Musk’s X a legal defeat, ruling that the platform must immediately provide researchers with access to data on politically related content ahead of the country’s Feb 23 election.