See Mishna in Yadaym 3, 5.
The Gemara in Massechet Megila 7A exposed a Machloket:
Rab Judah said in the name of Samuel; [The scroll] of Esther does not make the hands unclean...
{This is a Machloket tanaym see here Rabbi Shim'on's opinion R`Simeon vs. Rq Josuah} R`Simeon says that Koheleth is one of those matters in regard to which Beth Shammai were more lenient and Beth Hillel more stringent, but Ruth and the Song of Songs and Esther [certainly] make the hands unclean'! - Samuel concurred with R`Joshua.
If the Gemara says that he concurred with R"J, it is a sign that the Halacha is not as he says, but as R Shimon says. See Tshuvat Rav Hay Gaon
here (in the left column of the page) and see
here in the right top concerning touching naked Megilat Ester.
See Rambam Sefer Taharot, hilchot Avot haTum'a 9, 6
and see Magen Avraham (S.A. O.C. 147 S.K. 1) says that Megilot are as Sefer Tora, and that Rambam do not follow the opinion of Shmuel in Gemara cited above.
The Rama, says "ולא נהגו כן" and the Mishna Brura, and Beur Halacha, explains that some Poskim allowed to touching Sefer tora) when the person washed ons'e hands (Mordechay in name of Raavia, Rashba, Tosfot[1]). But there is no hilightment of a difference between S.T. and Megilah
Conclusion
- We found no differences in Rishonim between Megila and S.T,
- But we found a Machloket in both, some rishonim allow to touching S.T and Megila with cleaned hands, and some others prohibited.
- It seems that the Rema recommends a compromise between the 2 opinions, relying on the leniency of allowing touching after washing for Megila (and other books of Nakh), but being stringent for a Sefer Torah.
[1] Tosfot says in conclusion that after netilat yadaym, it is prohibited to touch sefer Tora as Megila