A South African court on Tuesday upheld a ban on leaders of a boisterous opposition party from attending a speech this week by President Cyril Ramaphosa opening the new parliamentary session after they were sanctioned for disrupting the event a year ago.