The funeral of their grandfather marked the princes’ first public appearance together in more than a year.