Got hit by batch reassignments (had assigned a lot by hand and didn't want to screw up my role-playing) and I can confirm that R4s and R5s are assigned to the bigger/badder warships consistent with the class priorities I set ... when the minimum rank for those warships are set to R3. Set it above R3 and the ship will not be automatically assigned a commander, but the R4 and R5 commanders you might want to assign to them will be assigned to other ships instead. I think this could be used as way to prevent fighters from being assigned commanders---could allow for a command variant fighter with identical specs, but with "minimum rank and class priority" set for it to be the only fighter in the squadron auto-assigned an officer.
So, to recap, if you want the auto-assignment to crew your best capital ships with R4s and R5s (maybe important for those who customize their rank titles), make sure the minimum rank is set to R3 and adjust the class priority accordingly (lower is better).
(I gave myself gaps between ship types so I could even prioritize between older and newer classes within a type. For example, dreadnoughts and carriers get class priority 1-4, destroyer-types 4-9, frigates 10-14, etc.)