“Kaniya” and “niya” are words that indicate possession. It is “kaniya” when placed before the noun and becomes “niya” when placed after. Following this rule, the pairs of example sentences you made are therefore the same and correct.
I think we tend to use “niya” more if we are only using it once in a sentence. However, when you are using it twice, the sentence will sound better if you use both styles. In your example sentences, Kinakausap niya ang "kanyang" kapatid and Kinakausap niya ang kapatid "niya", though both are grammatically correct, the first one sounds better. Of course, you may also say it as, “Kanyang kinakausap ang kapatid niya”.
“Kaniya” and “niya” are used for the 3rd person singular.
The other pairs are:
Singular –
1st Person – “Akin” and “ko”
2nd Person – “Iyo” and “mo”
Plural –
1st Person – “Amin” and “namin” (exclusive); “atin” and “natin” (inclusive)
2nd Person – “Inyo” and “ninyo” (you may often hear “ninyo” said as “nyo”)
3rd Person – “Kanila” and “nila”