Here's an XDA instructions to root Samsung S5 G900A (AT&T):
https://forum.xda-developers.com/att-galaxy-s5/general/guide-merry-christmas-heres-t3516196
That's the only solution I found working!
1) Save these to the Samsung SD card:
2) Now on your Desktop PC, download this firmware:
COMBINATION_ATT_FA44_G900AUCU4AOF1_ATT4AOF1.zip
3) Install the "COMBINATION" firmware using Samsung Odin (you'll have to boot your device by pressing Volume Down + Home + Power ON)
This will wipe ALL data on the device! Backup your stuff before proceeding.
4) After this new firmware installed and loaded, open Android file manager, go to the SD card, and install those APKs: Flashfire, SuperSU, and TowelRoot.
5) Connect to the internet (Wifi), and then go into "Settings > Date and Time" and tick the "Automatic date and time" box. This is mandatory for TowelRoot to work.
6) Run TowelRoot app -> "make it ra1n". Now you'll have the root binaries installed.
7) Run SuperSU app -> "new user" -> update SU binaries -> reboot.
8) Run FlashFire app -> grant it root access -> flash ZIP -> choose the OF3 firmware from SD -> set options to Mount /system read/write -> Hit "flash".
You're done! Enjoy Samsung S5 with Lollipop unlocked!