If B is the time the Barnes family used their sprinkler, and T the time the Trans family used theirs, the amount of water for the respective families are 35B and 40T.
B+T=60 total time, so B=60-T.
35B+40T=2300 total amount of water.
35(60-T)+40T=2300,
2100-35T+40T=2300,
5T=200, T=200/5=40 hours, so B=60-40=20 hours.
The Barnes family used their sprinkler for 20 hours and the Trans family for 40 hours.