Why is one user banned for a year while the other only for 7 days?
The duration of the ban is automatically chosen by the system while banning a user. It takes into consideration the previous history of the user. Moderators can override this, but usually they don't. It is an escalation. First warn, then 7 days, then 30 days, and then 365 days. Sometimes 1 year wouldn't be enough, and CMs go for more, say like 50 years:
Why is one user's recent post deleted by a mod as offensive and also warned in comments not to ask such anti-XYZ questions, but why hasn't the other user also been warned?
The post deletion shows "offensive" because the post was flagged. If you can see that a mod has deleted the post, then it implies that the mod didn't flag it as offensive themselves, but instead a normal community user flagged it as offensive. Also, you mention about the user being warned in comments once before being suspended. That probably wasn't needed, but moderators are sometimes encouraged to warn users to be nice. Directly sending the mod message along with the suspension is usually the way to go.
What steps are mods taking to ensure their actions are not biased?
The mods have ensured that their actions are not biased by suspending both users. Had they been biased, they would have looked away. Given that they have handled the flags cast by the community and then suspended both the users is ample proof that they are not biased.
To a lay user like myself it appears as if mods are handing out different punishments to different users for the same type of behavior.
Yes, this is advocated by the system itself! Think about it like the fine for jumping a traffic signal. The first one is usually a small amount, but the third one would be a larger fine, and include suspension of driving license. The police aren't biased at all. In fact it is the public who need to make sure that they mend their ways.
It also gives the impression that if you belong to the same sect as one of the mods, you are given a longer rope.
This reminds me about Alexander Pope's famous quote about how we see the world to be biased. Always assume good faith unless proven otherwise.