See the thing is, there is no non determinism here. Simply because, we have 2 cases.
Case 1: If input starts with a and is followed immediately by b, then you know for sure it's L1.
Case 2: After a, if you see another a, then you know for certain it's L2. So clearly it is a DCFL.
You can simply follow up with their PDAs with these guidelines, and see there's no non determinism. The main key in this question is that 'a' and 'ab' are acting as a clue here. Had it been the case that both the languages started with aa, then it won't be DCFL.