The latter; it scales linearly.

R weapon (non-grail) is worth 10 points per level
R grail is worth 20 points per level
Rs need 5 x current_level points in order to level up.

SR weapon (non-grail) is worth 35 points per level
SR grail is worth 50 points per level
SRs need 10 x current_level points in order level up.

It is justifiable to level up a weapon as long as the points you put in is less than the points you'd get back doing so.
There is no practical reason to level up a weapon once the points you put in is greater than the points you'd get back doing so.