I am doing a project which require an mpu9250 accelerometer to be connected to a Raspberry pi. Both are kept at a distance of 20m apart. What is the easiest way of data transfer without losses?
It is basically axiomatic that can't achieve "without losses". The best you can do is reduce them.
Have a CPU local to the MPU9250 that reads the data. Read it repeatedly to ensure you got the right values. (Drat. I forgot to do this! Time to consider more updates.)
Use a communication link between the local CPU and the controlling PI that uses at least CRC32 for error detection, and includes receipt confirmation and retransmission.
(Note that Ethernet and WIFI both do the former, and TCP does the later. This can simplify implementation. But don't feel yourself restricted to these protocols.)
Finally, if you are really paranoid, use redundant devices: two (or more) MPU9250s, local CPUs, power supplies, and communication links. If you are really really paranoid, even redundant PIs.