You need to run (there are other ways but this is probably the easiest) vipw(8) after restoring /etc/master.passwd. Don't change anything in the editor, just exit. This re-creates the binary database file /etc/master.passwd.db and the plain text /etc/passwd file. You don't have to do anything with /etc/group after restoring it from backup, it is used directly in its plain text form.
To make sure your mail aliases are up to date run newaliases(1) after restoring /etc/mail/aliases.
To make sure your mail aliases are up to date run newaliases(1) after restoring /etc/mail/aliases.