You sure that fridge was completely new, never used? If there was water in the dispenser water lines from a previous user that may have been why the ants are there.

Small creatures (bugs) often seek out sources of water, even tiny sources. Food without water nearby is not sustainable, so controlling the ants access to water might help you get rid of them.

Shutting off and capping the fridge water exit for a while might help, but also close access to the sink drains whenever you are not using the sink (put the plugs in). Kitchen and bathroom. No dishes or cups with water left on the counter.

Once they get established somewhere, it can take real effort to eradicate ants. If they have a nest somewhere in the fridge insulation (for example) then you would need to deal with that.

All the above is Internet Advice (TM) - your situation may be different and the ant appearances may have little to do with that new fridge.