Realizing topological surface states in a lower-dimensional flat band