I 'd like to know in 140 yrs when bitcoin wouldn't be mineable then how would this 51% attack be still work?
It'd be normally "mineable". Mining won't stop after a certain block. The only thing that is dropped to 0 is the block subsidy, and will happen in 120 years. 51% attack has nothing to do with it, and will always be possible to accomplish (although, unlikely) as long as there's the Bitcoin network.