It is a forum rule that you must show your attempt or give your thinking before we can help you.
Alright, my thinking is that for C=N there is a resonance structure +
. This is actually similar to carbonyl resonance. That said, in pyrimidine, such resonance results in a para
carbocation next to the (another) nitrogen, while for pyrazine, such resonance results in meta carbocation next to the (another) nitrogen. This inductive effect difference as a result of distance explains the basicity.
I am really not quite sure.