Return json list of values in SQL Server 2016 using data from 2 columns
If you are able to use FOR XML PATH('')

SELECT  DISTINCT
 QUOTENAME((STUFF(
    (
      SELECT ',' + try_convert(varchar(4),mt.B)
      FROM [dbo].[myTable] mt
      WHERE mt.a in ('X','C')
      FOR XML PATH('')
    ), 1, 1, '')));


If not, you could do a lot of REPLACE()ments

    SELECT  DISTINCT
 QUOTENAME(REPLACE(REPLACE(REPLACE(REPLACE((STUFF(
    (
      SELECT  mt.B as '}'
      FROM [dbo].[myTable] mt
      WHERE mt.a in ('X','C')
      FOR JSON PATH, WITHOUT_ARRAY_WRAPPER
    ), 1, 1, '')),'"',''),'}',''),'{',''),':',''))


Result for both:

(No column name)
[1995,1962]