How to optimize query with ORDER and LIMIT?
While the records under branch_id = '12345678' and each of the two providers are sorted in the order you want, they aren't in a sorted order once they've been pulled out (because you've got two sets that are pushed together).

You might get an improved sort if you pulled the top 13 records for the branch_id and each of the providers separately. These should already be in the order you want. Then, UNION ALL the two result sets and grab the top thirteen from that. Since they're already sorted in the right order, the engine may realize that and do something faster than a HEAP SORT.

NOTE: Depending on the total number of rows involved, the simple expedient of grabbing the top 13 rows for each branch and provider may speed things up tremendously, in that the heap sort has to sort through all the possible matches to find the top 13, whereas we've limited the possible row count to 26 at most.

Of course, this doesn't scale well. If the number of branches and providers in the query is ultimately variable, then you would either need to write a new version of the query each time the number of either of those changed, or build some really hairy dynamic SQL. If that's the case, then trying to further limit the pool of candidate rows should help; consider putting some sort of date range into the query.

UPDATE: joanolo kindly put together the actual code for this, with a data sample of 900 records; here's the dbfiddle.uk link. It confirmed that the engine did pick something other than a heap sort - specifically, a quicksort. However, as joanolo notes, you need a reasonably large number of records for this to make a difference; with 900, it's faster, but not that much.