To access the related lists you first need to cast the generic SObject type to the correct type:
List<Contact> contactList = new List<Contact>();
for (SObject sob : query_result) {
Contact c = (Contact) sob;
contactList.add(c);
List<Case> caseList = c.Cases;
List<Task> taskList = c.Tasks;
// Do whatever you want here with the lists
}
Bear in mind that you will have a separate list of cases and tasks per contact.
You don't explain why you are using a dynamic query; it would be simpler to just use static SOQL:
List<Contact> contactList = [select ... from Contact ... where ...];
for (Contact c : contactList) {
List<Case> caseList = c.Cases;
List<Task> taskList = c.Tasks;
// Do whatever you want here with the lists
}
PS
If you want to avoid any specific types and just use SObject methods:
for (SObject sob : query_result) {
List<SObject> caseList = sob.getSObjects('Cases');
List<SObject> taskList = sob.getSObjects('Tasks');
// Do whatever you want here with the lists
}