Had to solve the same problem a few years back using AGK.
Was for an app to show scores and such for horse-showjumping. Showed them the high-score list function, whereupon they observed that it only sorted on score.
"And that is a problem?" I asked.
"Well yes!" was the reply.
"Why? Can't the winners podium fit more than one horse?"
"We don't put the horses on the winners podium!"
"So what's the problem?!"
My reasoning was not well received. They insisted on sorting on score first, time second. So if two or more had the same score, they'd be differentiated on time to finish.
That required a bit of head-scratching, a pot of coffee and two large Red Bull before a working solution could be presented the morning after.
After the initial sort based on score - the list had to be iterated over. Where two scores was equal, it'd note the first index, and add to an accumulator until it encountered a score that was higher. Then the list from index of first equal index to first equal + accumulator index was sent to a function, sorted on time and reinserted into the complete list.
I did not use the built in sorting function, but my own home-cooked selection-sort routine. Not great on big datasets or partially sorted lists, but one of the best on entirely unsorted lists of small to medium size. Also, easy to implement.