It doesn't seem the most elegant sentence ever written, but yes, the second "of" is grammatically correct: it is a matter of brainwork, rather than (a matter) of some other thing.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.