As a surgery prelim, I see this attitude with my co-residents (and attendings :/) all the time. I think it mostly extends from already being the busiest service in house, then being consulted by the ED and having to add even more work to their long list of things to do. They're just mad that they have more work.
My program doesn't have an EM program, so I think the culture here is a little different. Even from my inside view of both surgery 'and' EM, it seems that the ED relies on surgery a lot for things that I KNOW ED physicians can manage, ie somewhat complicated laceration repairs and I&Ds, chest tubes, dislodged g/j-tubes, etc. So I can understand how that can get frustrating. A lot of the department is run by midlevel providers and family medicine physicians, with limited EM trained physicians, so I think this may have something to do with it as well?
They know I reapplied/matched EM, and they still make negative comments around me, and then end it with "but no offense." As if that helps, lol. They always tell me, "I wish you would stay with us for surgery; I hate losing a good resident to EM." I hate the mentality. I've just tried my best to show them a different perspective and that EM physicians ARE smart and hard working. I've found that some of them have even begun asking the ED attendings clinical questions and for help, which before they wouldn't respect most things they said.
I guess my point is, everyone just needs to understand where the other is coming from. And OP, on rotations or as a resident, my plan is just try to bust their misguided perception of ED physicians by being the opposite. Work hard, be smart, know your information, be able to defend your stance with clinical evidence, take charge, take initiative, etc.