Terminal - how to batch transfer files to other macs
It is so tedious to do it manually connecting with Finder, transfer
  the files and continue with the next one...


Yes it is.  There's a GUI solution - Apple Remote Desktop (ARD) was designed with this (as well as much more) in mind.


  Is there a way to do it with Terminal (scp or other tool) so that I
  can just write an script and see how it's automatically done?


Yes there is, but there needs to be some preliminary work done first to make this an automated system.

What you need:


an account with admin privileges  on each machine
Remote Login enabled
create an SSH key to authenticate you without a password
small script to copy the files (optional; so you don't have to keep typing the command over and over)


Account with admin privileges and remote login.  These are  self explanatory.  Setting up your SSH keys for a password-less login is detailed in the post "How to SSH in one line"

Using SCP to copy a file, your command could be as simple as:

scp foo.bar admin@computer1:/remote/directory/location/foo.bar


With the SSH keys setup, you won't be prompted for a password.

You could even script this for a batch of computers:

#!/bin/bash
computers=(comp1 comp2 comp3)            #Array of computer names
rdir="/remote/directory/location"        #Remmote directory
file="foo.bar"                           #filename to be xfered
user="admin"                             #login username

for comp in $computers
do
    scp ${user}@${comp}:${rdir}/${file}
done

exit


The script will iterate through the array computers copying the file foo.bar to the remote directory until there are no more items left then exit.