Is it correct to say 'The account will remain not active'? Can we use 'not' in such a position in the sentence? Or is it better to say 'The account will remain inactive'? What grammar rule is applied here?
Inactive is better. This is not a grammar point, but a matter of style.
Using "not" introduces an ambiguity, as it could be taken to mean "... will not remain active", a"different meaning entirely. In such a sentence using "remain not [adjective]" is rarely the best way to say something.
Say "remain inactive" instead of "remain not active". Say "remain unhappy" instead of remain not happy". If the adjective doesn't have a negation you may rephrase: Instead of "remain not red" say "still hasn't turned red" (or something similar depending on the exact meaning)
I don't think there is a grammar rule as much as what is common. Both "not active" and "inactive" mean the same thing, but in this context the more natural expression is "inactive", simply because that's how native speakers talk.
Your account will be inactive [until you fix some problem]. I can then reactivate it for you.
In addition, it's common to use the negative version of adjectives with remain, rather than using "not":
The computer virus remained inactive until a particular user logged in, then it went to work.
The strange package remained unnoticed all morning, until Sally almost tripped over it while running through the hall.
The outcome of the election remained uncertain even as the final votes were being counted.
"Not" is more often used when talking about the current state of an object, especially if you want to emphasize that it is not in some (expected) state:
The computer virus was not active, at least not until the right user logged in.
The package was not opened, even though it was the children who found it first, and Sally was usually very curious about such things.
"Inactive" is a better choice of words. It positively states what state the account will be in.
In most cases, we intuitively assume that "active" and "inactive" are the only two possible options. However, there are times where there are other cases. Consider the case of a system where an account may be "active," "inactive," or "pending." In such a case, "not active" could mean "inactive" or it could mean "pending." This sort of ambiguity comes up whenever we use a negative in our construction, and it is up to the listener/reader to determine whether there is a third option, like "pending" or not.
If you use a positive statement, "the account will remain inactive," it clears up any ambiguity that could arise.