#Pyth, 27 24 22 bytes
Pyth, 27 24 22 bytes
ssrD0m,lded.gr0k@+Gr1G
Try it online here.
ssrD0m,lded.gr0k@+Gr1GQ Implicit: Q=eval(input()), G=lowercase alphabet
Trailing Q inferred
r1G Uppercase alphabet
+G Concatenate with lowercase alphabet
@ Q Keep those characters in Q which are also in the above
.g Group the remaining characters, as k, using:
r0k Convert k to lowercase
(Grouping preserves relative order)
m Map the sorted groups, as d, using:
ld Length of d
, Pair the above with...
ed ... last element of d
D Sort the above...
r 0 ... by their lowercase values
ss Flatten, then concatenate the result of the above into a string, implicit print
Edit: Golfed 3 bytes by ordering by character before group, previous version: sm+ldedo,lNr0eN.gr0kf}r0TGQ
Edit 2: Golfed off another 2 bytes by formatting output before any ordering, previous version: sm+ldedlD.gr0krD0f}r0TGQ
Edit 3: Golfed off another byte by changing the filter, thanks to @FryAmTheEggman. Also had to fix a bug when OP clarified that a single letter can appear more than 9 times, which added a byte back on :o( Previous version: srD0m+lded.gr0kf}r0TGQ