I think it's fine. If we change the order, it works:
Of the two boys, Tom behaves more politely.
Putting the words this way round seems to deal with anyissues about 'of'. Can behaviour be polite? I can't see why not. We can certainly have rude behaviour.![]()