As per problem statement described by you that car’s cold start is ok but once car is driven for quite a while and then attempt to start fails. Perhaps, it might be due to some weakened battery cell. I may be wrong but as said earlier, please take it to toyota dealership