Ratel (the visual UI) is written using the Go client. dgraph4j (the java client) uses some external libraries to handle client server interaction using grpc. It is possible that there is some bottleneck there, that might be alleviated by tweaking some settings.
I will try and write some code similar to the example that @avi.jain7143 posted using the Go client and run some comparisions, and then debug further.