Time average for two caches , cpu and ram
Almost right. A subtlety not mentioned in the question is that an access to the next-level memory is generally not started until the access to the current level is known to be a miss.

This means that ALL accesses will take time T1, regardless of whether they hit in L1. Similarly, (1-a) accesses will take additional time T2, whether or not they hit in L2. And then (1-b) of the accesses to L2 will also incur the penalty of a main-memory access.

So the final equation becomes

$$T_{average} = T1 + (1-a)T2 + (1-a)(1-b)Tm$$