Portuguese Prime Minister Antonio Costa resigned on Tuesday, just hours after prosecutors detained his chief of staff in a probe into alleged corruption in his administration’s handling of lithium mining and hydrogen projects.