Insert characters into entire row and union with continue of row_number
You could use GROUP BY GROUPING SETS and the GROUPING() function:

SELECT 
    idx = ROW_NUMBER() OVER (ORDER BY GROUPING(a_id), a_id),
    a = CASE WHEN GROUPING(a_id) = 0 THEN a_id ELSE 'Total' END, 
    number = COUNT(*),
    value = SUM(amount)
FROM #t
GROUP BY GROUPING SETS ((a_id), ()) 
ORDER BY idx ; 


In older versions (that don't have GROUPING SETS) you could use ROLLUP instead. In even older versions (or any version if you prefer a simpler query), you could split the query into 2 parts and UNION ALL with:

SELECT 
    idx = ROW_NUMBER() OVER (a_id),
    a = a_id, 
    number = COUNT(*),
    value = SUM(amount)
FROM #t
GROUP BY a_id

UNION ALL

SELECT 
    1 + COUNT(DISTINCT a_id),
    a_id, 
    COUNT(*),
    SUM(amount)
FROM #t

ORDER BY idx ; 


Tested at rextester.com