Just for anyone who stumbles across this – I found an easy solution to put the ticks outside the colorbar (as shown by @Serigne Mbacké Coly) and remove them on one side completely:
ggplot(mtcars, aes(x = cyl, y = gear, fill = mpg)) +
geom_tile() +
coord_equal() +
theme(
legend.position = 'top',
legend.ticks.length = unit(c(-.15, 0), 'cm'), # different lengths for ticks on both sides
legend.ticks = element_line(color='black') # just to show the ticks on a white background
)