It wouldn't really be easier, for two reasons, say there is 25 posts per page and the same person posts 9 times then they're will be a query 9 times to check if he's a mod where you could get away with a temp cache system.
Though what you suggested is good.
PHP Code:
$post[usergroupicon]='<img border="0" src="{ imagesfolder }/'.$post[usergroupid].'.gif">';
as the only code and create an icon for every usergroup, just make sure that some are either 0 x 0 pixels and others can be icons.