Working with what you already have you could do this ...
SELECT id, min(SN) FROM
(
SELECT id,
ROW_NUMBER() OVER(ORDER BY id ASC) AS SN
FROM json
) src GROUP BY id
Which gets rid of your duplicate and only shows the lowest row number
ajson1 1
ajson3 3
ajson4 4
But if you want an auto-increment row number then you should consider using an IDENTITY column on the table itself. This will always be unique - even if records are deleted and others subsequently added and any specific row will always have the same number. E.g.
create table json2
(
sn int identity(1,1),
id varchar(max)
)
insert into json2 values
('ajson1'),
('ajson1'),
('ajson3'),
('ajson4')
select min(sn), id
from json2
group by id
Notice how the sql is a little simpler
However, if the results you wanted were actually
ajson1 1
ajson3 2
ajson4 3
then the query would just be
SELECT id, ROW_NUMBER() OVER(ORDER BY id ASC) AS SN
FROM json
group by id