Immediately after the death of Prince Philip, Prince Charles became the Duke of Edinburgh as the eldest son of Prince Philip. So even if the Queen had outlived Charles, Prince William would have already inherited the Dukedom of Edinburgh following Charles.
I think Charles was the fifth Duke of...