Is the tank always friendly?

The tank is always an optional boss, regardless of route. It is actually not hostile, like the rest of the amusement park machines. During my first run of Route A, I, too, attacked everything on sight before realizing the machines were not attacking me. The tank is the same way.

However, if you want 100% Unit Data Completion, you'll have to fight it at least once. The tank will also drop a Machine Core, which you can sell for quite a bit of cash, if you need that.