Shadow badges can be given out be subsector dukes or higher. As Imperial Warrants only come from the Emperor himself (As far as I know, though I believe an archduke can in some circumstances), then the Warrant should take precedence, as it is coming from the higher-ranked noble.
I'm fairly sure that there is a mention of an Imperial edict that allows for archdukes to issue their own, more limited, warrants. I can't recall where I've seen it, though, so it may be fanon rather than canon. The ability of dukes to issue ducal warrants is not, AFAIK, supported by any canon, but I believe it has been accepted as true for many years. Or maybe it's just me.
The Shadow Badge of Humaniti allows its bearer to break any and all laws the agent feels he has to in the course of his duties. Whatever it takes to succeed in his mission, this licence will protect the agent from local and Imperial prosecution. The Shadow Badge is why Imperial spies are feared throughout Charted Space. Imperial spies are empowered to do whatever they must; their missions are of a higher priority than morality and legality.
<snap> <snap>
Whoops! There goes my belief suspenders.
It's not that I don't believe in Imperial dukes who would sanction the breaking of Imperial law and the violation of treaties with the member worlds. But I don't believe in anyone with any pretense at being an honorable man doing so officially and institutionalized in that way. Also, the degree of oppression it would take to make the high-tech, high-population member worlds swallow something like that is much bigger than how I think the Imperium has been portrayed in canon up till now. YMMV.
Excerpt from Imperial membership treaty boilerplate:
aragraph: 89: The Imperium reserves the right to ignore any and all provisions in this treaty if it feels like it.
aragraph: 90: The subsector duke can use this treaty to wipe his bottom any time he feels like it.
But putting that aside and assuming for purposes of argument that the proper edicts for the issuance of Shadow Badges do in fact exist:
This is nothing like an Imperial warrant. A warrant delegates the power to do stuff that the Emperor has a legal right to do. It does not allow the holder to violate laws the Emperor has promulgated. A Shadow Badge appears to be the equivalent of that famous "absolution as good as any" from The Three Musketeers by Alexandre Dumas. In the book, Cardinal Richelieu writes a note "It is by my order and for the good of the state that the bearer of this has done what he has done". The note is given to the Cardinal's secret agent, Mylady de Winther, as a "Get out of jail free" note (It, of course, falls into the wrong hands). Mylady's note allowed her to escape punishment (by the French authorities) for crimes she might commit in the Cardinal's service but it didn't allow her to go down to Le Havre and order a fleet to invade England.
Incidentally, a Shadow Badge might protect an Imperial agent from criminal prosecution by anyone in the Imperium, but I don't see how it can provide immunity from other legal systems.
(Also, I think the number of Imperial agents that get captured by member worlds might be on the low side statistically, with a correspondingly high number of agents that just disappear without a trace. Just a suspicion...)
Hans