Indonesia’s top court has overturned a law that denied recognition and legal rights to followers of indigenous faiths.