When two Chiyuvim compete with each other, we apply the rule of Tadir Kodem.
When a Minhag and a Chiyuv compete with each other, then the rule of Tadir.is not applicable
Krias Hatorah & Megilas Esther are both Mitzvos. Therefore Tadir Kodem and Krias Hatorah comes first. Whereas the leining of Rus, Koheles & Shir Hashirim are only a Minhag. You can have a Minhag to be done before the Mitzvah even when the Mitzvah is Tadir.