well, you would need to differentiate the two servers by some means.
Both servers cannot run on same IP and port.
Now, as far as I understood the question, you have custom dns entries:
a.example.com that points to your routers external IP
b.example.com that points to your routers external IP
both IP's are same and as far as I know, no DNS entry can add custom port change to the end (a.example.com:81) to make the server be different.
Since IP traffic goes ONLY by numbers, Router only knows who the packet sender is, not what DNS entry it used to get router IP.
Based on that, what you are asking is impossible.
Your router will NEVER know if person asked for a.example.com, b.example.com or xyz.joke.com as long as it points to routers external IP.
You would need two external IP's or people would need to specify the 2nd server port as different when connecting:
a.example.com (for port 80)
a.example.com:81 (for port 81)
and then you would forward port 80 traffic to internal port 80 and port 81 traffic to internal IP/port you want.
edit: the post doesn't take into account if the router can do ip/port forwarding since even if it could, the situation as described by OP is impossible to attain since router will never know what DNS entry people requested the page with.