The Sesame framework supports a Federation Sail
which you can use to wrap several Sesame repositories (living in different servers/locations) into one virtual store. You could try and use that instead of using Allegrograph's bespoke federation code (which seems geared to multiple repositories on a single server only):
// create your AG repositories the same way
AGServer server = new AGServer(SERVER_URL1, USERNAME1, PASSWORD1);
AGRepository repo1 = server.getRootCatalog().openRepository(REPO1);
AGServer server2 = new AGServer(SERVER_URL2, USERNAME2, PASSWORD2);
AGRepository repo2 = server2.getRootCatalog().openRepository(REPO2);
// Use a Sesame Federation to combine them
org.openrdf.sail.federation.Federation federation = new Federation();
federation.addMember(repo1);
federation.addMember(repo2);
federation.setReadOnly(true); // assuming you only use it for query
Repository combinedRepo = new SailRepository(federation);
combinedRepo.initialize();
(ObDisclaimer: above code written from the top of my head, I may have overlooked a required config detail to get this to work - but you get the gist hopefully)
An alternative is that you work with SPARQL's support for federation, via the SERVICE clause. This will require that each repository you want to query is accessible via HTTP as a SPARQL endpoint though.