Part of it is a bug and part of it is a feature.
First the bug,
https://github.com/sympy/sympy/blob/7524499458cf114b32e3aa6e8acdb77e846111f9/sympy/core/evalf.py#L1264 needs to be changed. It should be changed from from_rational(x.p, x.q, prec) to from_rational(x.p, x.q, prec, rnd). Otherwise round down is used instead of round nearest.
This doesn't affect much though. same phenomena happens at 5128 instead of 5158.
Now for the feature part.a.n(2) doesn't guarantee you that the result will be rounded nearest to 2 decimal digits. a.n(2) only guarantees that the internal representation of |a-a.n(2)| < 0.5e-2.
Here's what sympy does.
dps = 2 (digits) is converted to prec=10 (bits)
.n routine first evaluates the rational with prec+4 bits and then rounds the result.
Larger rational is rounded to p=15977*2**-14 = 0.9751586914...
Smaller rational is rounded to q=15966*2**-14 = 0.9750976563...
In the round down case 5159 is rounded down to p and 5158 is rounded down to q
In the round to nearest case 5129 is rounded to p while 5128 is rounded to q.
Then sympy normalizes these mpfs to 10 bits.
There are now 2 choices
Larger float is rounded nearest to r = 997*2**-10 = 0.
9755859375Smaller float is rounded nearest to s = 996*2**-10 = 0.9746093750
These two are the results you get, but SymPy prints only 2 decimal digits of the numbers and therefore prints 0.98 for the larger and 0.97 for the smaller.