Once you publish a layer over to ArcGIS Online it becomes a standalone Hosted Service on ArcGIS Online and there is no connection maintained.
So, if you get the Query layer over to ArcGIS Online the connection with the SDE will break and the updates made will not be reflected automatically.
Now, to overcome this challenge you can use the append functionality to append the updates made. In the below URL scroll down to the Append Section for a better understanding.
Further, if are looking for an automated workflow, I can recommend you create a model using ModelBuilder in ArcGIS Pro, which will include the tools required to automate the task of appending data.
Some of the resources for you to get started:
Note: Once you create the model, you can save the model and schedule it for an automated run, so let's say the model you created will run automatically at midnight and get the updates appended.
For this scheduling: https://www.esri.com/arcgis-blog/products/arcgis-pro/analytics/schedule-geoprocessing-tools-and-models-in-arcgis-pro-2-5/
This is not the end, if you want to go further, you can export the model as a Python script, that can be customized and used in Windows Task Scheduler for a scheduled run.
More resources: