I must admit i had to read your post a couple of times before i could see the context between the two sensor you are talking about.
I've got some extra information regarding the DTC P0138 which according toyota is related to heated oxygen sensor (Bank 2) - post catalytic converter sensor.
As far as the information I´ve giving you here are taken from a Yaris with the engine code (1KR-FE) from around approx. 2008 and these engines is fitted with zirconia oxygen sensors on both pre and post the catalyte converter.
So what´s installed on your Yaris depends on what engine code it has.
It looks that you got two problems - one with the pre oxygen sensor and a another with the post oxygen sensor or maybe its a combined problem !.