Grouping Data Based on a Header Record

Attribute Expressions are just Arcade expressions that run with the JavaScript of the page, and have nothing to do with the actual data. For instance, when a popup loads with an Attribute Expression, the Arcade simply tells the popup to add another item which is the value from an operation against the data fields. The value (in your case, sum of two fields) is being done each time the popup loads, and therefore not storing it anywhere. So - no, the value cannot be stored via Arcade Expression to the database.

ArcGIS Online does not have anything that provides a mechanism to do this. Although there have been requests to add such functionality, it really is outside of the business plan for Esri to include such functionality, as it would be an option to not use some of there software which provides such functions.

If you want to calculate the sum of two fields of data, it will take another processor to read the data, calculate, and update a sum total field. There are tools to do that, and depending on your needs some solutions may be better than others. If you need this information live and dynamically, meaning as values change in the table, you need this sum field to update, then you will need something like GeoEvent Server to monitor updates to the feature service. The GeoEvent Server server role does require special licensing and is another product that would run in the ArcGIS Enterprise environment. If you have access to the database where the data is serviced from, then you could look into a database trigger. Database triggers can be setup in the database to perform queries when other queries take place, i.e. perform a calculation and update a field when data has changed. Database triggers are only a possibility though if you have access to the database management system. If you go with GeoEvent Server or Database Triggers, just a fair warning that the data being displayed in an ArcGIS Online map still takes time (could be just a few seconds) to show the updated value. If you're using something like Collector for ArcGIS, then the updated value will take even longer to show since the update interval is not fully supported across the ArcGIS Online solution sets.

If you do not need the data to be live or dynamically calculated, you could setup a python script to run periodically as a scheduled service. The script would read the data and perform a calculation against the data. The data of course will not show the correct sum value until the service refreshes it's connection to the data store. You can setup the script to run against the local data in a database, or use the ArcGIS API for Python to update through the feature service.