YouTube has agreed to pay $24.5 million to settle a lawsuit filed by President Donald Trump after he was suspended from the platform in 2021, a court filing shows.