A state appeals court will decide in coming weeks whether chimpanzees are entitled to “legal personhood” in a case that could lead to expanded rights for animals such as gorillas, elephants and dolphins, according to the lawyer advocating for a 26-year-old chimp named Tommy.