I just created the integration of Ranorex and TestRail.
I included the Ranorex dll as Reference in the Ranorex (plus the JSON library the API is mentioning). Then I created a C# file in Ranorex and added the code as mentioned by Tobias to push Ranorex results to TestRail.
I added this file as part of each test case, so that it is executed, when Ranorex finishes the test case.
As precondition to this - each test case in Ranorex must define as parameter the id of the TestRail test case. So ideally you have a 1:1 relation between test cases in Ranorex and TestRail.
Furthermore the test suite in Ranorex must define as parameter the run id from TestRail.
I start now a test suite from command line with the current run id, Ranorex executes the test cases and sends results then via the TestRail API to the TestRail cloud.