Sielke V. answered 03/19/19
Native German Speaker for Online and In-Person Tutoring
Both could be correct, the difference is that Akkusativ (auf eineN Baum) implies the cat started to climb onto / into the tree, the Dativ (auf eineM Baum) gives German speakers the idea that the cat is already on / in the tree and climbs around some more. Akkusativ is used for "movement" from place A to place B, Dativ for all activities that do not include "movement".