In your first example, while I'd prefer with for the preposition, they are both acceptable, and are both interchangeable. Gerunds and infinitives generally function similarly, although sometimes changes in syntax are required. The one you chose will be based on which best fits into the rhythm or voice of your writing.
The second set of examples are a bit more problematic. First of all, unless I'm misunderstanding, the verb should be processes.
The system process processes A [in order] to obtain B, containing C.
The system process processes A [in order] to obtain B, which contains C.
The problem here is that you have a restrictive clause--i.e. one that is needed to modify the word it identifies, which in this case is B--so the appropriate relative pronoun is which, not that. Always use which for restrictive clauses and that for non-restrictive clauses.
Also, in the first of these, containing C is a participial phrase in the present tense. It's also modifying B.
In both cases you need a comma after obtain B, and [result] B is being modified by each.