Yes: an attached object is still an object
The definition of objects is given in the rules on p. 246 as:
For the purpose of these rules, an object is a discrete, inanimate item like a window, door, sword, book, table, chair, or stone, not a building or a vehicle that is composed of many other objects.
Both a window or door are normally attached to a building with hinges, and a gate is essentially just an oversized double-door. This is exactly covering your use case. You will be able to affect a gate with telekinesis.
Wether you will be able to rip it out of its hinges depends on how strong those hinges are, and would require a check as DC discussed in the accepted answer. The DM will have to rule if the gates are too strong to even allow a check, or at what level to set the check's DC.
Benchmarks: A character with Strength 20 can be expected exert enough force to move 600 pounds (see PHB p. 176, Push, Drag, or Lift), and city gates that are there to protect the city from invaders should be expected to be built strong enough to withstand the capacity of a single human, even a very strong one. A hill giant, which we might assume should be able to rip out city gates, could exert enough to move 2,520 pounds. Telekinesis can move a maxium of 1,000 pounds, somewhat more than the human but far less than the giant.
DCs: Telekinesis is a 5th level spell, so assuming that the caster has maxed their spellcasting ability score, they would have at least +9 on these rolls. If the DC were 25, this would give them a 25% chance to succeed, and they could rattle the gates a few turns before they came off. If the DC was 30, it would only be possible for level 13 or higher casters (with +10 on their roll) to eventually rip them out.