I'm wondering why the first substitution does not work, the second, however, does.
g := q*N__1/N: algsubs(N__1/N = X__1, g); q*X__1
(I gave a detailed explanation in an answer to your question here.)